Pip not recognizing PyTorch with ROCm installation - python

On the PyTorch website it lists two blocks of commands for the ROCm version installation. The first one, that installs torch itself, goes well, but when I try to import it shows this message.
ImportError: libtinfo.so.5: cannot open shared object file: No such file or directory
Also, when trying to install the torchvision package with the second block of commands, it shows a similar error.
ModuleNotFoundError: No module named 'torch'
This only happens for with the ROCm compute platform. Installing with CUDA works just fine, but unfortunately I don't have a NVidia GPU.

I believe it was a bug that haven't been fixed. You can make a local symbolic link named libtinfo.6.so to /usr/lib/libtinfo5.so, in the same folder as libtaichi_core.so
This should solve it,

Related

CUDA_HOME environment variable is not set

I have a working environment for using pytorch deep learning with gpu, and i ran into a problem when i tried using mmcv.ops.point_sample, which returned :
ModuleNotFoundError: No module named 'mmcv._ext'
I have read that you should actually use mmcv-full to solve it, but i got another error when i tried to install it:
pip install mmcv-full
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Which seems logic enough since i never installed cuda on my ubuntu machine(i am not the administrator), but it still ran deep learning training fine on models i built myself, and i'm guessing the package came in with minimal code required for running cuda tensors operations.
So my main question is where is cuda installed when used through pytorch package, and can i use the same path as the environment variable for cuda_home?
Additionaly if anyone knows some nice sources for gaining insights on the internals of cuda with pytorch/tensorflow I'd like to take a look (I have been reading cudatoolkit documentation which is cool but this seems more targeted at c++ cuda developpers than the internal working between python and the library)
you can chek it and check the paths with these commands :
which nvidia-smi
which nvcc
cat /usr/local/cuda/version.txt

Module installed in Anaconda, same interpreter with Spyder yet Spyder gets "ModuleNotFoundError"

I have installed the netcdf4 library through
conda install -c anaconda netcdf4
And it shows up fine on my conda environment:
However, when I try to import it in Spyder, I am getting an
"ModuleNotFoundError: No module named 'netcdf4'"
I have tried the solutions here. As you can see below, both the interpreters are the same (in tools/preferences it's set as python.exe, not pythonw.exe):
Yet when I try to import the netcdf4 module, it says there is no module named this.
Any ideas what the cause could be? It's been two days of trying to get Anaconda to work and it has not been a smooth experience at all, really close on giving up on Anaconda as a whole.
Added per request, a screenshot of my entire IDE. Notice in the console I ran pip install netcdf4, where it says I already installed it. Directly below is importing the module and the error:
And how the console looks on each startup:
The docs/tutorial used stated
import netcdf4
While now it is case sensitive
import netCDF4
Such a simple fix..

IntelliJ cannot find some generated TensorFlow references

I wrote some TensorFlow code in Python. It compiles and runs fine. However, some names cannot be resolved by IntelliJ.
The error displayed when hovering over such an unfound reference is Cannot find reference '...' in 'tensorflow._api.v1.data'; the expanded message starts with Inspection info: This inspection detects names that should resolve but don't..
One example of such an unresolved reference is tf.data.Dataset. When I navigate to tf.data, there is only an __init__.py module in there, that starts with # This file is MACHINE GENERATED!.
There are many such packages, and they are in External Libraries. What is the proper way to fix this issue?
I faced a similar problem with tf.contrib part. I installed the TensorFlow version 1.10.0 with Anaconda. It uses the conda package manager. To install TF
conda install tensorflow==1.10.0
Installing with Conda solved my problem.

errors with import library in Anaconda

I am facing a strange error. I have installed pyrenn module with pip install in conda environment and solved an ANN problem successfully. But when I restarted the kernel in jupyter or spyder, I am not able to even import the module which shows error: module 'pyrenn' has no attribute 'CreateNN'. But it definitely has the module and it worked last time.
what may be the possible problem?
If you look at your screenshot it shows a path ~/ANN study/pyrenn/pyrenn.py. So not only you are creating a conflicting folder name pyrenn you are also creating a conflicting importable file pyrenn.py.
Follow the thumb rule of not naming the folders and your files which conflict with modules that you will uses or are existing.

lutorpy for shared memory between python and torch

I am trying to install lutorpy to load a network trained in torch and use it in python code. I get the following error:
lutorpy/_lupa.c:299:17: fatal error: lua.h: no such file or directory
I do have lua.h in torch/install/include folder.
I'm following the instructions here and get this error:
https://github.com/imodpasteur/lutorpy
Currently, lutorpy only support the standard torch installation, which means install torch in your home folder. So if that's the case for you, you problem mostly likely to be solved by start a new torch installation in your home folder.
In the meantime, you can track this issue for supporting arbitrary installation of torch.

Categories