bmild / nerf

Code release for NeRF (Neural Radiance Fields)
http://tancik.com/nerf
MIT License
9.83k stars 1.37k forks source link

ImportError: No module named '_pywrap_tensorflow_internal' error when running run_nerf.py #111

Closed akshayxml closed 3 years ago

akshayxml commented 3 years ago

I am getting the following error after setting up the conda environment and then running run_nerf.py inside it:

Traceback (most recent call last): File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 18, in swig_import_helper fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(file)]) File "/home/akshay/anaconda3/envs/nerf/lib-python/3/imp.py", line 296, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 20, in swig_import_helper import _pywrap_tensorflow_internal ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run_nerf.py", line 5, in import tensorflow as tf File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 18, in swig_import_helper fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(file)]) File "/home/akshay/anaconda3/envs/nerf/lib-python/3/imp.py", line 296, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/akshay/anaconda3/envs/nerf/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 20, in swig_import_helper import _pywrap_tensorflow_internal ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

akshayxml commented 3 years ago

resolved by removing few of the dependencies from environment.yml

HollyDQWang commented 2 years ago

Currently facing the same error. Would you mind kindly elaborate on exactly which dependencies you have removed?

zichen34 commented 2 years ago

I think @AkshayViru is right. I met the same error when I create the environment from the environment.yml file. But this error is gone when I directly create the environment with specific packages and versions. conda create -n nerf python=3.7 cudatoolkit=10.0 tensorflow-gpu=1.15 -c conda-forge