ptrblck:

The model is not used to create any of these tensors and will thus not be trained, or is this your use case?


My ideal is
1 model input material image
2 model out put some material parameter
3 render image via by material parameter(form blender render engine)
4 count loss between input image and image(render form blender) which two image  should look similar
but I get error like this
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
so I add requires_grad=True to blender_image



 x06lan:

blender_image = torch.tensor(blender_image,requires_grad=True)


What do I need to do for make the model trained?
Thanks a lot.