tensorflow本人智障错误汇总

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/csdnicewing/article/details/80953034

1:安装GPU-tensorflow那些坑:

    详见我的另一篇因为中文输入法崩溃掉而写的英文博文。

2:tf.slice

     tf.slice可以给我们返回一个切成的slice的列表,别被官方文档的例子迷惑了

3:legacy_seq2seq的输入

    要输入一个list, list里面都是长度为batch的一维tensor, 所以记得给placeholder切片。

4:   Dst tensor is not initialized.

    This is a common bug while training on a public SVM, and it's cause is that your GPU doesn't have enough memory for you. So if you're a user of NVIDIA-gpu, use the command  " nvidia-smi " to check what's happening in your GPU.

5:  手动指定GPU之后意外小规模地使用了其他GPU

    原因:以指定在gpu6上计算为例。使用tf.device("/gpu:6")只是保证tensorflow只使用gpu6计算,其他gpu还是会按照规定的使用率(默认是占满)去占

    解决方法是再手动指定一下可见设备,这样就强硬地解决了这个问题。

扫描二维码关注公众号,回复: 4218068 查看本文章

    代码:在引用了os库之后      os.environ["CUDA_VISIBLE_DEVICES"] = "6"

                 或是在运行前,在终端使用cuda的命令设置变量:CUDA_VISIBLE_DEVICES=0 python xxx.py

   其中xxx.py就是你要执行的python脚本的文件名

猜你喜欢

转载自blog.csdn.net/csdnicewing/article/details/80953034
今日推荐