RustX
April 18, 2021, 4:51pm
1
I’m trying to utilize GPU of Colab for quadratic optimization. I followed this link to install the CV2 but after installation completed I couldn’t find any
cv2.cpython-36m-x86_64-linux-gnu.so
file, so the cv2 version remained native. Is there any special thing I have to do after installation?
berak
April 18, 2021, 5:03pm
2
your link is unfortunately behind a paywall.
can you show us the cmake cmdline & (console) output ?
this worked ok for me, a few weeks ago
one of the problems on colab is, that you cannot install python modules persistantly , my current workaround:
after building, copy the cv2.xxxx.so to some external place (e.g. a google drive)
whenever you need it - restart the runtime (so it forgets about preinstalled cpu only 4.1.0)
copy your own cv2.so to your work folder
start your python code, and pray, it picks up the local version before the global, preinstalled one
1 Like
RustX
April 19, 2021, 4:28pm
3
The latest cv2 version was installed successfully, however after this code block:
!cp -r /content/build/lib “/content/drive/My Drive/cv2_cuda”
!cp /content/build/lib/python3/cv2.cpython-36m-x86_64-linux-gnu.so “/content/drive/My Drive/cv2_cuda”
!cp -r /usr/include/opencv2 “/content/drive/My Drive/cv2_cuda”
the output is:
cp: cannot stat ‘/content/build/lib/python3/cv2.cpython-36m-x86_64-linux-gnu.so’: No such file or directory
Why it can’t find the cv2.xxxx.so?
berak
April 19, 2021, 4:36pm
4
hehe, ran into something similar this morning, – default python was changed recently to 3.7 on colab
RustX
April 19, 2021, 4:40pm
5
You mean it is possible to utilize GPU on Colab only with the python 3.7? Or it is impossible at all?!))
berak
April 19, 2021, 4:50pm
6
no, i meant, you probably have to look for:
/content/build/lib/python3/cv2.cpython-37m-x86_64-linux-gnu.so
(36<–>37)
have a look at your cmake output again, and check python --version
1 Like