Swalkr
Swalkr

Reputation: 56

Why do I get a no directory error, when I have installed all the libraries for Tensorflow?

I am following this tutorial: https://github.com/RomRoc/objdet_train_tensorflow_colab/blob/master/objdet_custom_tf_colab.ipynb

When I attempt to run the first block of code:


!apt-get install -qq protobuf-compiler python-tk

!pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive

!pip install -q pycocotools

%cd ~/models/research
!protoc object_detection/protos/*.proto --python_out=.

import os
os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/'

!python object_detection/builders/model_builder_test.py

I get this error:

/content
object_detection/protos/*.proto: No such file or directory
python3: can't open file 'object_detection/builders/model_builder_test.py': [Errno 2] No such file or directory

I've installed all the libraries in Google Colab, just as the tutorial says, so I don't understand why I get this error or how to fix it. Any help would be much appreciated.

Upvotes: 1

Views: 528

Answers (1)

user11530462
user11530462

Reputation:

I am able to recreate your issue in Google Colab

!apt-get install -qq protobuf-compiler python-tk

!pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive

!pip install -q pycocotools

%cd ~/models/research
!protoc object_detection/protos/*.proto --python_out=.

import os
os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/'

!python object_detection/builders/model_builder_test.py

Output:

[Errno 2] No such file or directory: '/root/models/research'
/content
object_detection/protos/*.proto: No such file or directory
python3: can't open file 'object_detection/builders/model_builder_test.py': [Errno 2] No such file or directory

Solution: To fix this issue, you can change your current directory /content to /root/models/research by including below two lines before running your code.

%cd
!git clone --quiet https://github.com/tensorflow/models.git

Here is the updated code

%cd

!git clone --quiet https://github.com/tensorflow/models.git

!apt-get install -qq protobuf-compiler python-tk

!pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive

!pip install -q pycocotools

%cd ~/models/research
!protoc object_detection/protos/*.proto --python_out=.

import os
os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/'

!python object_detection/builders/model_builder_test.py

Output:

/root
/root/models/research
2020-05-08 15:23:47.035256: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1

Upvotes: 1

Related Questions