Skip to content
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

i have some question #6

Open
ghost opened this issue Oct 21, 2019 · 1 comment
Open

i have some question #6

ghost opened this issue Oct 21, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 21, 2019

Error message :

Done!
Traceback (most recent call last):
File "train.py", line 112, in
train(epoch)
File "train.py", line 25, in train
data = (data - data.min().data[0]) / (data.max().data[0] - data.min().data[0])
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

so , I changed the code (as below)

data.min().data[0] -> data.min()

*.data[0] -> *.item() ( * Denotes all variables that use data [0].)

Does this deviate from your intention in your code? @emited

@ghost ghost changed the title i have some questions i have some question Oct 21, 2019
@RuifMaxx
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant