opteroncx / SESR

SESR: Single Image Super Resolution with Recursive Squeeze and Excitation Networks
28 stars 13 forks source link

Training Error regarding variable i #9

Open msiraj83 opened 6 years ago

msiraj83 commented 6 years ago

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

opteroncx commented 6 years ago

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

opteroncx commented 6 years ago

I have fixed this bug, thank you.

msiraj83 commented 6 years ago

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.

opteroncx commented 6 years ago

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

msiraj83 commented 6 years ago

@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 ??

opteroncx commented 6 years ago

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