CovPoolFER icon indicating copy to clipboard operation
CovPoolFER copied to clipboard

tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed>

Open PR1706 opened this issue 5 years ago • 4 comments

I am running this code, after training several epochs on the two data sets, this error will occur, can you give me some advice? Thank you. Traceback (most recent call last): File "src/train.py", line 330, in main(parse_arguments(sys.argv[1:])) File "src/train.py", line 192, in main args.learning_rate_schedule_file) File "src/train.py", line 229, in train err, _, _, step, reg_loss = sess.run([loss, train_op, redun, global_step, regularization_losses], feed_dict=feed_dict) File "/home/miao/.conda/envs/tensorflow_1.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/home/miao/.conda/envs/tensorflow_1.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 997, in _run feed_dict_string, options, run_metadata) File "/home/miao/.conda/envs/tensorflow_1.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1132, in _do_run target_list, options, run_metadata) File "/home/miao/.conda/envs/tensorflow_1.2.0/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1152, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed>

PR1706 avatar Sep 28 '19 05:09 PR1706

I have the same problem. Have you solved it?

Fansgithub2019 avatar Nov 18 '19 00:11 Fansgithub2019

Sorry, I can not solve the problem. I have tried some methods to solve it, but it faild.

------------------ 原始邮件 ------------------ 发件人: "JFanL"<[email protected]>; 发送时间: 2019年11月18日(星期一) 上午8:11 收件人: "d-acharya/CovPoolFER"<[email protected]>; 抄送: "ZRL"<[email protected]>;"Author"<[email protected]>; 主题: Re: [d-acharya/CovPoolFER] tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed> (#10)

I have the same problem. Have you solved it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

PR1706 avatar Nov 18 '19 01:11 PR1706

I solved it. In sess, the normalized place went wrong. mean, var = tf.nn.moments(m, axes=[2]) leads to tf.nn.batch_normalization(x=m, mean=mean, variance =var, offset=shift, scale=scale, variance_epsilon=0) The data does not correspond (the number of digits is different) and cannot be calculated. It needs to be changed to mean, var = tf.nn.moments(m, axes=[0,1, 2]), it is solved.

Fansgithub2019 avatar Nov 19 '19 00:11 Fansgithub2019

Where is the code "mean, var = tf.nn.moments(m, axes=[2])"? I can't find it. Please help me. Thank you very much.

------------------ 原始邮件 ------------------ 发件人: "JFanL"<[email protected]>; 发送时间: 2019年11月19日(星期二) 上午8:43 收件人: "d-acharya/CovPoolFER"<[email protected]>; 抄送: "ZRL"<[email protected]>;"Author"<[email protected]>; 主题: Re: [d-acharya/CovPoolFER] tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed> (#10)

I solved it. In sess, the normalized place went wrong. mean, var = tf.nn.moments(m, axes=[2]) leads to tf.nn.batch_normalization(x=m, mean=mean, variance =var, offset=shift, scale=scale, variance_epsilon=0) The data does not correspond (the number of digits is different) and cannot be calculated. It needs to be changed to mean, var = tf.nn.moments(m, axes=[0,1, 2]), it is solved.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

PR1706 avatar Nov 19 '19 04:11 PR1706