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

Torchvision install guide might be a bit misleading. #4

Open
Zeit42 opened this issue Mar 13, 2019 · 1 comment
Open

Torchvision install guide might be a bit misleading. #4

Zeit42 opened this issue Mar 13, 2019 · 1 comment

Comments

@Zeit42
Copy link

Zeit42 commented Mar 13, 2019

After installing PyTorch using your guide, I proceeded to install torchvision. I followed the repo you linked and I used the following commands:

cd ~
mkdir torchvision_install && cd torchvision_install
git clone https://github.com/pytorch/vision
cd vision

And since you suggested we install from source, I followed the repo's guide and ran:

python setup.py install

The installation stops, because I don't have permissions in a certain folder that the setup.py is trying to write to. This is the log:

The following error occurred while trying to add or remove files in the
installation directory:

[Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/test-easy-install-4269.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

/usr/local/lib/python3.5/dist-packages/

Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

So instead of just python setup.py install, I do:

sudo python setup.py install

However, I got this error:

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at pytorch/pytorch#566).
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.

I tried

sudo python3 setup.py install

Which would make sense. Torchvision requires PyTorch, and PyTorch was installed in python3, as per your guide.

But it seems that I need to have Pillow installed first.

I'll try to go through installing torchvision using python3.5. But it's a bit worrying because in your requirements, you mentioned that the environment is Python 2.7, but so far, the installations seem to be in Python 3.5. Even the OpenCV Install guide for the Raspberry Pi installs it on Python 3.5.

I'll keep this updated as I work on installing torchvision.

@Zeit42
Copy link
Author

Zeit42 commented Mar 13, 2019

I tried the following:

cd ~
mkdir torchvision_install && cd torchvision_install
git clone https://github.com/pytorch/vision
cd vision
sudo apt-get install libjpeg-dev zlib1g-dev
sudo python setup.py install

and it went without a hitch.

And during the installation of OpenCV 4.0.0, I did the following in Step #6: Link OpenCV 4 into your Python 3 virtual environment:

cd /home/pi/.local/lib/python3.5/site-packages/
ln -s /usr/local/python/cv2/python-3.5/cv2.cpython-35m-arm-linux-gnueabihf.so

This way, I was able to run:

cd ~
python3

import cv2
cv2.version

After that, I downloaded the repository:

git clone https://github.com/savageyusuff/MobilePose-Pi.git
cd MobilePose-Pi
pip install -r requirements.txt

But I encounter the following error:

Collecting opencv-python (from -r requirements.txt (line 3))
Could not find a version that satisfies the requirement opencv-python (from -r requirements.txt (line 3)) (from versions: )
No matching distribution found for opencv-python (from -r requirements.txt (line 3))

I get the same error even when trying pip install opencv-python

Now I'm not sure how to proceed from this point.

This repo looks very promising but installing the dependencies seems to be a tad bit complicated. The pre-requisites PyTorch and TorchVision are installed in Python 3.5, but your code seems to work on Python 2.7?

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

1 participant