- 问题:
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
- 问题:
initializer = tf.contrib.layers.xavier_initializer(seed = 1)
解决:
initializer = tf.truncated_normal_initializer(stddev=0.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)
- 问题:
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)
- 问题:
TypeError: Calling.seed()
on instances is deprecated. Use the class methodFaker.seed()
instead.
解决:
降低faker的版本。安装的时候选择安装2.0.0版本
pip install faker==2.0.0