-
Notifications
You must be signed in to change notification settings - Fork 14
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
IndexError #3
Comments
Hi, I think it is a problem of PyTorch version. You can just follow the prompt message of the reported error. For the one-element tensor, e.g. losses and prec1, you can replace tensor[0] with tensor.item().Best regards,Hui Tang发自我的华为手机-------- 原始邮件 --------发件人: WeeshawChen <[email protected]>日期: 2020年5月12日周二 中午12:01收件人: huitangtang/DADA-AAAI2020 <[email protected]>抄送: Subscribed <[email protected]>主 题: [huitangtang/DADA-AAAI2020] IndexError (#3)
At first, I want to use my own dataset, it came across an error,
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
I found it in trainer.py
I thought it was the dataset problem, so I used the office31 as the training dataset, but still got the same problem
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
would you please tell me if there is something wrong with my confs?
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Well, thanks for your instant replying. So here is the code from trainer.py |
At first, I want to use my own dataset, it came across an error,
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
I found it in trainer.py
I thought it was the dataset problem, so I used the office31 as the training dataset, but still got the same problem
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
would you please tell me if there is something wrong with my confs?
The text was updated successfully, but these errors were encountered: