diff --git a/README.md b/README.md index 9a4f0ca..d1848f1 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,44 @@ export MAX_JOBS=8 Look through the commit history! This repository was started in July 2019. +### 9. Import Errors + +It is possible that after installation when trying to import torch the following error may occur: + +``` +Traceback (most recent call last): + File "", line 1, in + File "/usr/lib/python3.6/site-packages/torch/__init__.py", line 45, in + from torch._C import * +ModuleNotFoundError: No module named 'torch._C' +``` + +The reason for this is that the precompiled file has some libraries whose name must be renamed. To do so, you must enter the torch folder inside the python3.7 libraries folder. + +Depending on where you installed your python, the following path may vary, but usually it is (if you are not using a virtual environment): + +``` +$ cd /usr/local/python3.7/dist-packages/torch +``` + +Inside this folder you will find two files with names like this: + +``` +_CXXXXXXXX.so +_dlXXXXXXXX.so +``` + +(XXXXXXX represents just any name) + +You will need to rename these files so that their names are as follows: + +``` +_C.so +_dl.so +``` + +After this process you should already be able to run torch / torchvision normally. + # Remarks I provide no support for these builds, but feel free to ping me if something is broken. I am not to be held responsible if you burn something or fall down the stairs while using these. diff --git a/install_opencv_rpi.sh b/install_opencv_rpi.sh deleted file mode 100644 index 7ee54a3..0000000 --- a/install_opencv_rpi.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -sudo apt-get update && sudo apt-get upgrade - -sudo apt-get install build-essential unzip pkg-config - -sudo apt-get install libjpeg-dev libpng-dev libtiff-dev - -sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev - -sudo apt-get install libxvidcore-dev libx264-dev - -sudo apt-get install libgtk-3-dev - -sudo apt-get install libcanberra-gtk* - -sudo apt-get install libatlas-base-dev gfortran - -sudo apt-get install python3-dev - -sudo apt-get install libcurl4 - -sudo apt-get install cmake - -cd ~ -wget -O opencv.zip https://github.com/opencv/opencv/archive/4.0.0.zip -wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.0.0.zip - -unzip opencv.zip -unzip opencv_contrib.zip - -mv opencv-4.0.0 opencv -mv opencv_contrib-4.0.0 opencv_contrib - -sudo python3.7 -m pip install numpy - -cd ~/opencv -mkdir build -cd build - -cmake -D CMAKE_BUILD_TYPE=RELEASE \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ - -D ENABLE_NEON=ON \ - -D ENABLE_VFPV3=ON \ - -D BUILD_TESTS=OFF \ - -D OPENCV_ENABLE_NONFREE=ON \ - -D INSTALL_PYTHON_EXAMPLES=OFF \ - -D BUILD_EXAMPLES=OFF .. - -make -j4 - -sudo make install - -sudo ldconfig \ No newline at end of file