I tried to run the tensorflow tutorial in Jupiter notebook on my laptop but it gives me the error on the following codes:
!git clone --depth 1 GitHub - tensorflow/models: Models and examples built with TensorFlow
( error :‘git’ is not recognized as an internal or external command, operable program or batch file.)
%%bash
sudo apt install -y protobuf-compiler
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
(error: Couldn’t find program: ‘bash’)
how can I fix these errors?
thanks,
I believe you need to download an install git on your system first.
Also it is better in my experience when working in jupyter to create a python virtual environment and run code and installations within it:
1 Like
I addition to @gent.spah , if you are using Linux, you can just use “sudo apt install tensorflow” or “pip install tensorflow”. But, as @gent.spah said, it is better to use an virtual env. If you are using Conda environment, you can do a “conda install tensorflow” or “pip install tensorflow”.
Keep learning!
I am using jupyter through anaconda. I installed git and most of my issues are resolved except when I run bash. It gives me error running sudo code. Is this something I should install too?
Also is the virtual environment the same as anaconda?
Thanks for your help
Anaconda already creates a default virtual env named base but you can create and add a new kernel at any time. I use to use the cmder to run bash commands and when things cannot be fixed, I run the Windows WSL to run all my Linux commands.
2 Likes
+1 on the suggestion to create a dedicated environment. I would go further than @carlosrl and say not only can you do so, but you should do so. The primary reason is that this allows you to install specific versions of TensorFlow, Python, and other modules that are coherent with the Coursera environment from the classes. If you always install just the latest of everything you can run into non-backwards compatible changes that don’t run the class exercises as-is. A virtual environment allows you to isolate these configurations. I have one for the Deep Learning Specialization, one for AI for Medicine, and one for NLP, among others. For my own work I prefer the latest builds, but for running class exercises locally, I only update when Deep Learning does, which is infrequently. HTH
PS: I started out using Anaconda but found it rather bloated and switched to using conda instead. Much smaller default footprint.
1 Like