daniilidis-group / neural_renderer

A PyTorch port of the Neural 3D Mesh Renderer
Other
1.12k stars 248 forks source link

fail run examples on pytorch1.0 #54

Closed weigq closed 5 years ago

weigq commented 5 years ago

i run the example.py on pytorch1.0, and get the following error:

Optimizing:   0%|          | 0/300 [00:00<?, ?it/s]Traceback (most recent call last):
  File "example2.py", line 99, in <module>
    main()
  File "example2.py", line 80, in main
    loss.backward()
  File "/data7//app/miniconda/envs/shape/lib/python2.7/site-packages/torch/tensor.py", line 107, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/data7//app/miniconda/envs/shape/lib/python2.7/site-packages/torch/autograd/__init__.py", line 93, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: function RasterizeFunctionBackward returned an incorrect number of gradients (expected 11, got 10)

it seems that only the forward step can success.

nkolot commented 5 years ago

Will take a look and tell you. A recent merge must have broken this. Should be easy to fix.

nkolot commented 5 years ago

The latest version on github is able to pass all test cases for me. Maybe you should pull and try again.

weigq commented 5 years ago

@nkolot can you tell your compile environment? I am using Pytorch1.0, cuda9.0 on ubuntu16.

weigq commented 5 years ago

i fixed my problem, i compile with the torch in PYPI failed, then i use the torch from pytorch official website and success.