zhan-xu / RigNet

Code for SIGGRAPH 2020 paper "RigNet: Neural Rigging for Articulated Characters"
GNU General Public License v3.0
1.36k stars 189 forks source link

RuntimeErrror: There were no tensor arguments to this function - torch.cat(joints.shuffle) #53

Closed artursahak closed 3 years ago

artursahak commented 3 years ago

Dear Zhan-Xu, all the training code has been successfully executed but here is another issue when testing quick_start.py. I assume it is because of run_root_cls.py, but model_best.pth.tar has no issues during execution, besides printing the test_loss for the last checkpoint specified.

Traceback (most recent call last): File "quick_start.py", line 449, in <module> mesh_filename=mesh_filename.replace("_remesh.obj", "_normalized.obj")) File "quick_start.py", line 190, in predict_skeleton root_id = getInitId(input_data, root_pred_net) File "C:\JavaTemp\RigNet\mst_generate.py", line 105, in getInitId root_prob, _ = model(data, shuffle=False) File "C:\Users\alfre\anaconda3\envs\anewenv\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "C:\JavaTemp\RigNet\models\ROOT_GCN.py", line 130, in forward joints_shuffle = torch.cat(joints_shuffle, dim=0) RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors. Available functions are [CPU, CUDA, QuantizedCPU, Autograd, Profiler, Tracer, Autocast]

zhan-xu commented 3 years ago

This seems like the joint prediction step doesn't get any joints. Could you check why there is no joint extracted by visualizing that step only? It might because of the threshold or because of some misalignment of vox and mesh.

artursahak commented 3 years ago

Does the learning threshold impact as well?( I tried to change ROOTNET's joints_shuffle to torch.tensor, but the problem remained, also tweaked quick_start's threshold a bit). For visualization I assume using from utils.vis_utils import draw_shifted_pts, show_obj_skel, show_mesh_vox. Thanks.

zhan-xu commented 3 years ago

The network only learns the bandwidth. The threshold need to be set by the user. Yes you can use draw_shifted_pts to visualize the shifted points, draw_joints to visualize intermedia joints after meanshift.

artursahak commented 3 years ago

What threshold would you advise for training human models only?(my collected dataset consists only of human models)

artursahak commented 3 years ago

I think this issue comes from run_root_cls.py. Joints_shuffle are not obsolete and in run_root_cls.py the last checkpoint rushes out an error, and I think that it corrupts the file.

artursahak commented 3 years ago

Epoch50. train_loss: 0.101977. Epoch50. val_loss: 0.817965. val_acc: 0.880000 Epoch50. test_loss: 1.348911. test_acc: 0.909091 => loading checkpoint 'checkpoints/rootnet\model_best.pth.tar' => loaded checkpoint 'checkpoints/rootnet\model_best.pth.tar' (epoch 41) Traceback (most recent call last): File "run_root_cls.py", line 184, in <module> main(parser.parse_args()) File "run_root_cls.py", line 111, in main test_loss, test_acc = test(test_loader, model, args) TypeError: test() takes 2 positional arguments but 3 were given

artursahak commented 3 years ago

I visualized and no joints were found. You were right, but what may be the problem? I viewvox-ed the binvox-es, and the axis are aligned with obj.s's axes. Do you have any other idea why this error might persist?

artursahak commented 3 years ago

I am closing this issue, because the problem is clear, but I need your advising. Sincerely,Artur.

artursahak commented 3 years ago

Running all the files in given order and deleting the former checkpoints that I used to override upon, solved the issue. But the prediction isn't as good, maybe because only 50 models were given. Anyway, thanks.