简体   繁体   中英

Import tensorflow in jupyter notebook fails

When updating tensorflow to version 1.4, cudnn to version 6 and setting up SSL encryption and a password on my jupyter notebook server I constantly got the following error in notebooks:

ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory

Importing tensorflow inside python3 -i worked fine.

I realised that the necessary environment variable LD_LIBRARY_PATH is set when testing it with echo $LD_LIBRARY_PATH on the host but print(os.getenv('LD_LIBRARY_PATH')) in notebooks results in a KeyError .

Setting the variable in .bashrc and .profile didn't change anything.

The solution was to run jupyter notebook with a modified environment with env LD_LIBRARY_PATH=$LD_LIBRARY_PATH jupyter notebook .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM