Unable render neural network structural graph on kaggle notebook - kaggle

I got this message on Kaggle notebook
'Failed to import pydot. You must `pip install pydot` and install graphviz (https://graphviz.gitlab.io/download/), ', 'for `pydotprint` to work.'
Rendering NN structural graphs doesn't work. What is the problem? Is it a problem on Kaggle side? Code I was running was very simple.

The first thing to do is to turn on internet support on your kaggle notebook and install the following packages via pip packet manager:
!pip install pydot
!pip install pydotplus
!pip install graphviz

Related

Difficulty updating keras/tensorflow on mac

I am working on a jupyter notebook script which I used last year to train a neural network.
When I try to import the keras tokenizer:
from keras.preprocessing.text import Tokenizer
I receive this error
I have seen other posts which suggest that I need to update tensorflow. My anaconda environment tells me I have 1.13.1 installed. But when I try to update tensorflow-base to 1.15 in the anaconda navigator, I receive this error:
I can update tensorflow from my command line using:
conda install tensorflow=1.15.0
But this doesn't update tensorflow in my anaconda environment and the error persists in my notebook.
Any help would be much appreciated! As you can probably tell, I am a novice python user.
The error says some packages needed to update Tensorflow/Andaconda requires Python 3.11 or newer. Since not all of the error log can be seen however, I would upgrade to python 3.7 to be safe. You can download this from the official page: https://www.python.org/downloads/
If the problem persists, try using pip to update the packages(In bash) :
pip install tensorflow
pip install conda
If you get an error while using pip, try:
pip3 install tensorflow
pip3 install conda
This same method can be used to update keras:
pip install keras
or if that does not work:
pip3 install keras
If pip is not recognized at a command, Python 3.7 is not added to path. I do not have experience with macOS, but this article should go into enough depth.
https://realpython.com/add-python-to-path/#how-to-add-python-to-path-on-linux-and-macos

ROBOFLOW-tensorflow-object-detection-faster-rcnn_ cannot import name 'get_config' from 'tensorflow.python.eager.context'

I was trying to implement Fast RCNN model on my custom dataset using the google colab ROBOFLOW-tensorflow-object-detection-faster-rcnn.ipynb, but when I run the 'Install required packages' section ,Iam getting the error 'cannot import name 'get_config' from 'tensorflow.python.eager.context' . I tried to upgrade tensorflow and Keras , but not working
Tried Upgrade of tensorflow
Also trying to locally download the repository to try to import from tensorflow. Please help
Try to upgrade the tensorflow:
pip install --upgrade tensorflow
pip install --upgrade tensorflow-gpu
For me TF2.9 worked for the same ROBOFLOW colab notebook:
!yes|pip uninstall tensorflow
!pip install tensorflow==2.9

Why isn't tensorflow or pytorch recognized after I restart conda virtual environment?

Last night, I made a virtual environment and the only installs I made were as follows:
conda install jupyter
conda install notebook
pip install transformers
And I was able to run huggingface transformers perfectly, but today I reactivate my conda virtual environment and I'm met with this puzzling error:
And this is the runtime error
I even tried making a new virtual environment with the same depencies and today I got these errors upon performing pip install transformers
And this in jupyter notebook
HuggingFace Transformers need to be installed in conjunction to either Tensorflow or Pytorch. From the HuggingFace installation instructions:
First you need to install one of, or both, TensorFlow 2.0 and PyTorch.
So you should choose which machine learning platform you like more and install that too in your virtual environment.
For Tensorflow either pip install tensorflow or pip install tensorflow-gpu and for Pytorch pip install torch torchvision
For example, in a fresh environment, the following instructions should make your errors disappear (I'm assuming you have a GPU):
conda install jupyter
conda install notebook
pip install tensorflow-gpu
pip install transformers

XLNetTokenizer requires the SentencePiece library but it was not found in your environment

I am trying to implement the XLNET on Google Collaboratory. But I get the following issue.
ImportError:
XLNetTokenizer requires the SentencePiece library but it was not found in your environment. Checkout the instructions on the
installation page of its repo: https://github.com/google/sentencepiece#installation and follow the ones
that match your environment.
I have also tried the following steps:
!pip install -U transformers
!pip install sentencepiece
from transformers import XLNetTokenizer
tokenizer = XLNetTokenizer.from_pretrained('xlnet-base-cased-spiece.model')
Thank you for your help in advance.
After the
!pip install transformers and
!pip install sentencepiece
please restart your runtime and then execute all other codes.
I got the same error in google colab. Restarting the runtime did it for me.

ModuleNotFoundError: No module named 'bert' even after pip install bert-tensorflow and pip install bert-for-tf2

I have tensorflow 1.9.0 and after successful installation of bert using !pip install bert-tensorflow, I cannot import bert in Jupyter notebook. I even ran !pip install bert-for-tf2. Still no success.
It turns out I did not have tensorflow in my environment. Fixed after installing tensorflow.