【深度学习】记录TensorFlow遇到的错误

  1. 问题:
    WARNING:softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
    Instructions for updating:
    Future major versions of TensorFlow will allow gradients to flow
    into the labels input on backprop by default.
    See tf.nn.softmax_cross_entropy_with_logits_v2.
    解决:
    将tf.nn.softmax_cross_entropy_with_logits改成
tf.nn.softmax_cross_entropy_with_logits_v2
  1. 问题:
    initializer = tf.contrib.layers.xavier_initializer(seed = 1)
    解决:
initializer = tf.truncated_normal_initializer(stddev=0.1)
  1. 问题:
    AttributeError: module ‘scipy.misc’ has no attribute ‘imread’
    方法1:检查scipy的版本,改成1.2.1版本就可以,使用pip install scipy==1.2.1
    方法2:如果上述方法不行,将scipy替换成imageio包.
    如果没有安装,先用pip install imageio安装,然后再代码中写:
import imageio

myimage =scipy.misc.imread(img_path)

改成

myimage = imageio.imread(img_path)
  1. 问题:
    threshold must be non-NAN, try sys.maxsize for untruncated representation
    这句话引起的错误
np.set_printoptions(threshold=np.nan)

解决:
把上面这句代码块修改为:

import sys
np.set_printoptions(threshold=sys.maxsize)
  1. 问题:
    TypeError: Calling .seed() on instances is deprecated. Use the class method Faker.seed() instead.
    解决:
    降低faker的版本。安装的时候选择安装2.0.0版本
pip install faker==2.0.0
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值