You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run the folwoing example from the wiki in Google colab. I initialize the environment as it is stated on the readme file and I get the error about tensorfolow.
Error:
ImportError: cannot import name 'RegisterShape' from 'tensorflow.python.framework.ops' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py)
Error
`--> 177 from tensorflow.python.keras.layers.normalization import LayerNormalization
178 from tensorflow.python.keras.layers.normalization_v2 import SyncBatchNormalization
179
ImportError: cannot import name 'LayerNormalization' from 'tensorflow.python.keras.layers.normalization' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/layers/normalization/init.py)`
And the same error with the following initialization:
Hi all,
I am trying to run the folwoing example from the wiki in Google colab. I initialize the environment as it is stated on the readme file and I get the error about tensorfolow.
My code:
`from imageai.Detection.Custom import DetectionModelTrainer
trainer = DetectionModelTrainer()
trainer.setModelTypeAsYOLOv3()
trainer.setDataDirectory(data_directory="hololens")
metrics = trainer.evaluateModel(model_path="hololens/models", json_path="hololens/json/detection_config.json", iou_threshold=0.5, object_threshold=0.3, nms_threshold=0.5)
print(metrics)`
Initialization
!pip install tensorflow-gpu==1.13.1 !sudo apt-get purge nvidia* !sudo wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 !sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 !sudo apt-key add /var/cuda-repo-/7fa2af80.pub !sudo apt-get update !sudo apt-get install cuda=10.0.130-1
Error:
ImportError: cannot import name 'RegisterShape' from 'tensorflow.python.framework.ops' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py)
Alternative initialization
`!update-alternatives --install /usr/bin/python python /usr/bin/python3.7.6
!pip install tensorflow-gpu==2.4.0
!pip install keras==2.4.3 numpy==1.19.3 pillow==7.0.0 scipy==1.4.1 h5py==2.10.0 matplotlib==3.3.2 opencv-python keras-resnet==0.2.0
!pip install imageai --upgrade`
Error
`--> 177 from tensorflow.python.keras.layers.normalization import LayerNormalization
178 from tensorflow.python.keras.layers.normalization_v2 import SyncBatchNormalization
179
ImportError: cannot import name 'LayerNormalization' from 'tensorflow.python.keras.layers.normalization' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/layers/normalization/init.py)`
And the same error with the following initialization:
!pip install tensorflow-gpu==2.4.0 !pip install tensorflow-gpu==2.5.0rc0 !pip install folium==0.2.1 !pip install imgaug==0.2.6 !pip install bokeh==2.3.0 !pip install keras==2.5.0rc0 numpy==1.19.3 pillow==7.0.0 scipy==1.4.1 h5py==2.10.0 matplotlib==3.3.2 opencv-python keras-resnet==0.2.0 !pip install imageai --upgrade
Could someone please help me on the correct initialization for Colab?
The text was updated successfully, but these errors were encountered: