1、报错信息:tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [predictions must be >= 0] [Condition x >= y did not hold element-wise:] [x (sub_2:0) = ] [[-nan][-nan][-nan]...] [y (Cast_2/x:0) = ] [0]
[[{{node assert_greater_equal/Assert/AssertGuard/else/_1/assert_greater_equal/Assert/AssertGuard/Assert}}]] [Op:__inference_train_function_1223]
Function call stack:
train_function
问题原因:tf.sqrt()开根号导致在0处不可导NAN,可能出现梯度爆炸问题
解决方法:加个很小的数,或者将学习率调小
2、警告信息:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 10000 batches). You may need to use the repeat() function when building your dataset.
问题原因:batch_size和steps_per_epoch、validation_steps同时出现出现冲突
解决方法:保留batch_size或者steps_per_epoch、validation_step
3、The `batch_size` argument must not be specified for the given input type. Received input: <BatchData....
问题原因:可能数据集制作的时候就使用了.batch(64)做好了,就不用在fit中加入batch_size了?【纯属猜测,因为在自己环境跑没出现问题,而是在别人的平台上跑出现的问题】
解决方法:去掉batch_size参数
36万+

被折叠的 条评论
为什么被折叠?



