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

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

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

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.

How to solve the 'Attribute Error' in gym when colab is using GPU

here is my code:
!pip install box2d-py==2.3.8
import gym
env = gym.make('CarRacing-v0')
The err-msg is:
AttributeError: module 'gym.envs.box2d' has no attribute 'CarRacing'
screenshot
But the same code is ok when colab is using the CPU environment.
Try doing
pip uninstall torch
and installing cuda version again
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
by the way try to use CarRacing-v2 instead of CarRacing-v0
environment_name = "CarRacing-v2"

Downgrading TensorFlow from 1.15 to 1.14 not working

I have a colab notebook which was running tf1.15.0. I need to downgrade it to 1.14.0. In a cell, it run the following:
!pip uninstall tensorflow==1.15.0
!pip install tensorflow==1.14.0
import tensorflow as tf
print(tf.__version__)
However, it outputs:
> 1.15.0
What am I doing wrong please?
CS
IF you have import tensorflow cell before uninstall, you may need to restart notebook to make it effective.
IF you have not, make sure you are running the correct pip in the same python environment as the notebook, such as:
import sys
!{sys.executable} -m pip install xx
Do you have TensorFlow-GPU installed in the system? Because this is the same issue I was facing earlier, so try downgrading TensorFlow-GPU.
pip install tensorflow-gpu==1.14
or any other version of tensorflow-gpu.

error of import tensorflow as tf python 3.6.0

I downloaded the tensorflow package for python3.6.0 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy then installed it by pip, it showed successful . when I import tensorflow as tf,it failed like following
import tensorflow as tf
From Documentation
Install TensorFlow Python dependencies
To install TensorFlow, you must install the following packages:
numpy, which is a numerical processing package that TensorFlow requires.
dev, which enables adding extensions to Python.
pip, which enables you to install and manage certain Python packages.
wheel, which enables you to manage Python compressed packages in the wheel (.whl) format.
Install the dependency packages First.
or direct from command prompt.
pip3 install --upgrade tensorflow
for CPU version only for TensorFlow.
pip3 install --upgrade tensorflow-gpu
for GPU version of TensorFlow