FewShotLearning
FewShotLearning copied to clipboard
RuntimeError: One of the differentiated Variables appears to not have been used in the graph
Learner nParams: 32901
Traceback (most recent call last):
File "main.py", line 38, in
I run your code with py27 env. However the error occurs and I don't know what goes wrong?
Hi @dragen1860 @gitabcworld How did you solve this?
Hi, I did n't solve this problem. Have you got any solution?
I change metaLearner.py, line 174 like following:
torch.autograd.grad(loss, self.lstm2.parameters(), allow_unused=True, retain_graph=True)
It runs but Grads lstm + lstm2 print None .
Pricision goes up.
avg / total 0.21 0.22 0.19 7500
Not sure yet.
@elviswf can it work now? how about your final precision?
@dragen1860 I just get the script run. I think you can get it run too. The final precision is just like above. Some params may need changed. I will try it in next week since I'm working on another project. If I get something new I will update this comment.
@elviswf How is your latest progress?
Hi! I am sorry I could not work at this code for long. As @elviswf I am really busy working with other projects and I have not been able to dedicate more time to this project. So any help will be appreciated. I will try to do the changes @elviswf proposes and see if it solves the backprop problem as soon as possible.
Have anyone solve this problem(One of the differentiated Variables appears to not have been used in the graph)?
Have you encountered this problem? RuntimeError: CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 8.00 GiB total capacity; 5.57 GiB already allocated; 10.05 MiB free; 607.43 MiB cached) This problem(One of the differentiated Variables appears to not have been used in the graph) can be solved by adding allow_unused=True.
I change metaLearner.py, line 174 like following:
torch.autograd.grad(loss, self.lstm2.parameters(), allow_unused=True, retain_graph=True)It runs but Grads lstm + lstm2 print None . Pricision goes up.
avg / total 0.21 0.22 0.19 7500Not sure yet. Hello.Have you encountered this problem? RuntimeError: CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 8.00 GiB total capacity; 5.57 GiB already allocated; 10.05 MiB free; 607.43 MiB cached) Isn't memory released? I tried reducing batch-size but it didn't work either. do you have any good advice? Can you help me? Grateful.friend.