-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loss function problem #97
Comments
@alan0324 检查src_image和label_image的尺寸是不是对应:) |
感謝您的回覆!! 請問是以下嗎if name == 'main': |
另外補充我在for迴圈print出來的結果lm_loss shape: () |
@alan0324 对 看报错是你输入的原始图像和label图像尺寸不一致导致的 可以检查下;) |
@MaybeShewill-CV 您好,經過了一番嘗試,即使更改了原始圖像與label圖像的尺寸也沒有改變我的報錯信息,我的mse_loss還是會在for迴圈的計算中增加一倍,請問除了尺寸不一致以外,還有什麼可能會導致錯誤的原因嗎? |
附上我的尺寸信息 Set train image width__C.TRAIN.IMG_WIDTH = 720 Set train image height__C.TRAIN.CROP_IMG_HEIGHT = 240 Set train image width__C.TRAIN.CROP_IMG_WIDTH = 360 if name == 'main': if name == 'main': |
您好,我在執行train_model.py時遇到了loss張量不合的問題,以下是我遇到的問題:
Traceback (most recent call last):
File "F:\temp\demo\00\pythonProject\attentive-gan-derainnet\tools\train_model.py", line 324, in
train_model(args.dataset_dir, weights_path=args.weights_path)
File "F:\temp\demo\00\pythonProject\attentive-gan-derainnet\tools\train_model.py", line 116, in train_model
train_gan_loss, train_discriminative_loss, train_net_output = derain_net.compute_loss(
File "F:\temp\demo\00\pythonProject\attentive-gan-derainnet\attentive_gan_model\derain_drop_net.py", line 52, in compute_loss
auto_encoder_loss, auto_encoder_output = self._attentive_gan.compute_autoencoder_loss(
File "F:\temp\demo\00\pythonProject\attentive-gan-derainnet\attentive_gan_model\attentive_gan_net.py", line 333, in compute_autoencoder_loss
lm_loss = tf.add(lm_loss, mse_loss)
File "F:\temp\demo\00\pythonProject\venv\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "F:\temp\demo\00\pythonProject\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 7262, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__AddV2_device/job:localhost/replica:0/task:0/device:CPU:0}} Incompatible shapes: [1,60,90] vs. [1,120,180]
請問要如何解決此問題
非常感謝您提供的代碼!
The text was updated successfully, but these errors were encountered: