Imageai: Issues with TensorFlow on Google Colab

Created on 20 Nov 2019  Â·  6Comments  Â·  Source: OlafenwaMoses/ImageAI

Hi, I'm having issues getting the Custom Detection Model up and running on Google Colab and was hoping for some help.

I initially tried with tensorflow-gpu 1.15.0 but I got the '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string' error.

I then tried downgrading to 1.13.1 like the guide says, but now I'm greeted with the error: Failed to load the native TensorFlow runtime.

Any ideas on what I should do or what I'm doing wrong? I have made sure that I've selected GPU as the hardware accelerator.

Thanks!

Most helpful comment

I think I solved it. Basically I purged everything Nvidia from the Colab notebook and then manually installed Cuda 10.0.130:

!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-<version>/7fa2af80.pub
!sudo apt-get update
!sudo apt-get install cuda=10.0.130-1

Gonna close this issue now. Thanks for the tip @nguyengiakhiem0501 !

All 6 comments

Image AI train model using tensorflow-gpu 1.13.1. Tensorflow-gpu 1.13.1 work well with Cuda 10.0 (or newer). Google colab is using cuda 10.0.1. You should install tensorflow-gpu to you computer to train your model. (sorry, my Englist is bad)

I see. My computer is not very powerful so I would prefer to do it on Colab. Is there any other solution? (install Cuda 10.0?)

I think I solved it. Basically I purged everything Nvidia from the Colab notebook and then manually installed Cuda 10.0.130:

!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-<version>/7fa2af80.pub
!sudo apt-get update
!sudo apt-get install cuda=10.0.130-1

Gonna close this issue now. Thanks for the tip @nguyengiakhiem0501 !

I fixed this using

!pip install keras==2.2.4
!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

someone can share google colab notebook pre configured for ImageAI?

I'll with in next few hours

On Tue, Oct 27, 2020, 22:34 Luis E. R. Henriques notifications@github.com
wrote:

someone can share google colab notebook pre configured for ImageAI?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/OlafenwaMoses/ImageAI/issues/414#issuecomment-717406595,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIUFCO6OUB3KBX6BHWMK3NTSM4ACNANCNFSM4JPOWVOQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivam9804 picture shivam9804  Â·  3Comments

Danielv123 picture Danielv123  Â·  4Comments

c7jie picture c7jie  Â·  4Comments

letchfordnicholas picture letchfordnicholas  Â·  6Comments

Overdoze47 picture Overdoze47  Â·  3Comments