在Ubuntu服务器上使用tmux运行Tensorflow错误

时间:2018-08-04 07:44:19

标签: python ubuntu tensorflow anaconda tmux

我正在尝试使用tmux运行深度学习程序。但是似乎tensorflow不可用。

要启动tmux环境,请运行:

ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ tmux

然后在tmux环境中运行:

ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ source activate tensorflow_p36
(tensorflow_p36) ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'

导入除tensorflow以外的其他软件包,例如PIL或cv2,效果很好。将tensorflow导入tmux环境之外的工作。

我正在ubuntu 16 AWS服务器上运行它。可能是什么问题?

1 个答案:

答案 0 :(得分:1)

结束语。正如@ user2906838所指出的那样,问题是我在运行tmux之前就在anaconda虚拟环境中。当我在运行tmux之前退出环境并进入tmux内部环境时,一切正常进行。