SESR icon indicating copy to clipboard operation
SESR copied to clipboard

Training Error regarding variable i

Open msiraj83 opened this issue 6 years ago • 6 comments

Hello, I generated the .h5 file according to your instruction in issues #8. But now i got new error as attached in screen shot. sesr_i_variable_error

Where you define the variable i in the main.py file. The error generated by highlighted line in the attached file. main py

can you correct the code please

Thanks

msiraj83 avatar May 21 '18 06:05 msiraj83

imglist[i] ---> imglist[-1]

opteroncx avatar May 21 '18 08:05 opteroncx

I have fixed this bug, thank you.

opteroncx avatar May 21 '18 08:05 opteroncx

Dear @opteroncx

Thanks for your correction but now i got another error loss_x2.backward(retain_variables=True) TypeError: backward() got an unexpected keyword argument 'retain_variables' as attached in the screen shot another_error Its like undefined variable i think.

msiraj83 avatar May 21 '18 08:05 msiraj83

Are you using PyTorch with version > 0.2 ? Change to retain_graph=True may fix this.

opteroncx avatar May 21 '18 09:05 opteroncx

@opteroncx

Thanks you so much. Yea its now running. a little bit worry about this warning.. main.py:119: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number print("===> Epoch[{}]({}/{}): Loss: {:.10f}".format(epoch, iteration, len(training_data_loader), loss.data[0])) ===> Epoch[1](100/686): Loss: 12758226.0000000000 ===> Epoch[1](200/686): Loss: 6495788.5000000000 is it is ok ??

msiraj83 avatar May 21 '18 09:05 msiraj83

loss.data[0] --> loss.item() This won't cause any error if you do not update your Pytorch to 0.5.0

opteroncx avatar May 22 '18 07:05 opteroncx