小编Cat*_*aoz的帖子

没有GPU的机器上的TENSORFLOW,只能在CPU上运行它

我正在学习Tensorflow(希望将它与我的聊天机器人集成),并希望运行此处的示例:

https://www.tensorflow.org/tutorials/recurrent

我下载了建议的存储库,安装了tensorflow(现在是cpu-only版本,但是也试过了--gpu)但是我坚持这个:

 python ptb_word_lm.py --data_path=simple-examples/data/ --model=small --rnn_mode=basic
2017-09-21 17:38:09.856638: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-21 17:38:09.856685: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
  File "ptb_word_lm.py", line 532, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + …
Run Code Online (Sandbox Code Playgroud)

tensorflow

4
推荐指数
1
解决办法
1514
查看次数

将 for 循环应用于条件语句

这是一个示例(来自http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ifstatements.html 的代码片段):

if weight > 50:
    print("There is a $25 charge for luggage that heavy.")
print("Thank you for your business.")
Run Code Online (Sandbox Code Playgroud)

我想把整个代码放在即“for”循环中。使用 for(..){上面的代码在这里}会非常容易。我仍然找不到这样做的方法,我需要编写 for 循环并缩进下面的整个块。我想我在这里遗漏了一些东西......

python

-6
推荐指数
1
解决办法
85
查看次数

标签 统计

python ×1

tensorflow ×1