Ultra-Fast-Lane-Detection-v2 icon indicating copy to clipboard operation
Ultra-Fast-Lane-Detection-v2 copied to clipboard

ModuleNotFoundError: No module named 'nvidia.dali.plugin.base_iterator'

Open Aruen24 opened this issue 2 years ago • 7 comments

the cuda version must 10.2?

Aruen24 avatar Aug 04 '22 02:08 Aruen24

@wang911205 It is a problem of Nvidia DALI. If you didn't install DALI, please install DALI. If you have installed, please report more details.

cfzd avatar Aug 04 '22 08:08 cfzd

@wang911205 It is a problem of Nvidia DALI. If you didn't install DALI, please install DALI. If you have installed, please report more details.

I install nvidia-dali-cuda101. my CUDA Version: 10.1. and the cuda version must 10.2?

Aruen24 avatar Aug 09 '22 02:08 Aruen24

@wang911205 I think as long as the DALI version matchs the CUDA version, it should be ok.

cfzd avatar Aug 09 '22 06:08 cfzd

Can I install Nvidia - Dali on Windows?

Eliza-wxq avatar Sep 13 '22 05:09 Eliza-wxq

@Eliza-wxq It seems dali do not support windows.

cfzd avatar Sep 13 '22 13:09 cfzd

ModuleNotFoundError: No module named 'nvidia'

While I prepare to install TensorFlow 2.12.0, TensorFlow team have the following commands. But I get the error: ModuleNotFoundError: No module named 'nvidia'. What's wrong with the commands. Please indicate how to solve it. Thanks.

Install TensorFlow with pip https://www.tensorflow.org/install/pip

$ mkdir -p $CONDA_PREFIX/etc/conda/activate.d
$ echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
$ echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/:$CUDNN_PATH/lib:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
$ source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'nvidia' dirname: missing operand Try 'dirname --help' for more information.

With the similar context, TensorFlow team has the following answer on the installation error.

https://discuss.tensorflow.org/t/tensorflow-installation-error/15889

But it seems that the problem has not yet solved.

mikechen66 avatar Aug 02 '23 03:08 mikechen66

I have solved the problem but still can not use TensirFlow 2.12 or above

1 .Create tf env

$ conda create --name tf python=3.10
$ conda activate tf

2.Install cuda and cudnn in tf

Continue in the tf environment:

$ conda install -c conda-forge cudatoolkit=11.8.0
$ pip install nvidia-cudnn-cu11==8.6.0.163

(including the cublas downloading and installation)

But is has show the error. $ nvcc --version CUDA Toolkit is not installed.

3. Configure the env

mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/:$CUDNN_PATH/lib:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

After all the installtion are executed in the tf environment, it does not show ModuleNotFoundError: No module named 'nvidia'

4. Verification

python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

2023-08-03 17:42:07.337886: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-08-03 17:42:07.926267: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

Reference:

mikechen66 avatar Aug 03 '23 17:08 mikechen66