Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!pip install tensorflow==2.3.0 is not working on Colab #160

Open
tpootai opened this issue Mar 14, 2023 · 4 comments
Open

!pip install tensorflow==2.3.0 is not working on Colab #160

tpootai opened this issue Mar 14, 2023 · 4 comments

Comments

@tpootai
Copy link

tpootai commented Mar 14, 2023

Previously, the following command was utilized to install Tensorflow 2.3.0 in order to convert Darknet weights to a Tensorflow model within save_model.py:

!pip install tensorflow==2.3.0

However, currently Tensorflow 2.3.0 is not available, and the following error is persistently occurring:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.3.0 (from versions: 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.12.0rc0, 2.12.0rc1)
ERROR: No matching distribution found for tensorflow==2.3.0

I attempted to upgrade to TensorFlow 2.5.0 or the most recent version offered by Colab.

However, the issue remains that only the initial frame is being tracked, and the subsequent frames are not being tracked, yielding a zero track.

As a beginner, I would appreciate any assistance, and thank you in advance for your help.

P.S. I have done research on some issues and here are the references

  1. Bounding boxes not showing when using tensorflow-gpu #155
  2. Bounding boxes not observed #153
  3. error in "save_model.py" [UnicodeDecodeError] #159
  4. downloading tensorflow==2.3.0rc0 #156
  5. ! pip uninstall tensorflow #132
@mikalbre
Copy link

@tpootai
Change to python 3.8 by running:
!sudo update-alternatives --config python3
!sudo apt install python3-pip

run:
! pip install tensorflow==2.3.0

if you get some errors try to run this as well:
!pip install protobuf==3.19.6
!pip install certifi==2022.12.7
!pip install idna==2.10
!pip install tensorboard==2.9.1
!pip install tensorboard_data_server==0.6.1
!pip install requests==2.25.1

Then you should be all good!

@tpootai
Copy link
Author

tpootai commented Mar 27, 2023

Hi @mikalbre
Thank you for your clear and precise answer!

I tried what you proposed and got a few more errors. However, I managed to fix it through the method I mentioned below.
Please note that I am implementing this object_tracker.py code from this repo on Google Colab.

First, I change to python 3.8 and install libraries as @mikalbre said:

!sudo update-alternatives --config python3
!sudo apt install python3-pip

! pip install tensorflow==2.3.0`
! pip install protobuf==3.19.6
! pip install certifi==2022.12.7
! pip install idna==2.10
! pip install tensorboard==2.9.1
! pip install tensorboard_data_server==0.6.1
! pip install requests==2.25.1

I also install gdown to download video from my Google Drive to the runtime.

!pip install gdown
!pip install --upgrade gdown

Then before running ! python save_model.py --model yolov4 you must install 2 more libraries

!pip install opencv-python
!pip install easydict

After that, install 3 more libraries before running
! python object_tracker.py --video input_video.mp4 --output ./outputs/output_video.mp4 --model yolov4 --dont_show --count --info

!pip install Pillow
!pip install matplotlib
!pip install numpy==1.20

object_tracker.py should work fine if you do this by exact order

P.S. I think the main problem comes from library dependencies. If anyone reading this thread has a better method or the method I proposed also works fine with you, comments would be much appreciated!

@sunray2333
Copy link

I've tried this, but when I import tensorflow as tf, I found it still import tensorflow 2.12.0(from path /usr/local/lib/python3.9/dist-packages/tensorflow-2.12.0), tensoflow 2.3 was installed in path /usr/local/lib/python3.8/dist-packages, then I tried to insert this path in sys(sys.path.insert(0, '/usr/local/lib/python3.8/dist-packages/')), it mentioned Python version mismatch: module was compiled for Python 3.8, but the interpreter version is 3.9.2

@KarahanSensoy
Copy link

PLEASE HELPP!!
This also doesnt work. UPUPUP!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants