-
Notifications
You must be signed in to change notification settings - Fork 301
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
SOLUTION: IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number #27
Comments
The above change triggered an error in the log method plotting the losses at the end of the epoch: The following worked though:
|
I changed the code as follows :
However, there is a new warning:
The program can run, but some losses of train are so large. The trained model can't transform horses to zebras. The losses of train are shown as follows :
I really don‘t know how to deal with this problem. Please give me a hand, thanks. |
@Yang-Chenghao One solution is turn off the plotting loss with visdom part, by marking out line 63~68 in utils.py like below.
and use @pnzr00t 's loss, not mhaghighat's. By this way, I could manage to train with reasonable loss values:
|
Base code use old version on pytorch. In new version we must change this code from file utils.py
By this code
The text was updated successfully, but these errors were encountered: