Shimingyi / MotioNet

A deep neural network that directly reconstructs the motion of a 3D human skeleton from monocular video [ToG 2020]
https://rubbly.cn/publications/motioNet/
BSD 2-Clause "Simplified" License
562 stars 84 forks source link

Problem running quick start demo #31

Closed Mingos390 closed 3 years ago

Mingos390 commented 3 years ago

Hi, after executing the following command python3 evaluate.py -r ./checkpoints/wild_gt_tcc.pth -i demo I get this error message.


Building the network
Traceback (most recent call last):
  File "evaluate.py", line 137, in <module>
    main(config, args, output_folder)
  File "evaluate.py", line 73, in main
    parameters = [torch.from_numpy(np.array(item)).float().to(device) for item in h36m_loader(config, is_training=True).dataset.get_parameters()]
  File "/home/mingos/MotioNet/data/data_loaders.py", line 11, in __init__
    self.dataset = h36m_dataset.h36m_dataset(config, is_train=is_training)
  File "/home/mingos/MotioNet/data/h36m_dataset.py", line 14, in __init__
    self.cameras = h36m_utils.load_cameras('./data/cameras.h5')
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 97, in load_cameras
    R, T, f, c, k, p, name = load_camera_params(hf, 'subject%d/camera%d/{0}' % (s, c_idx + 1))
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 78, in load_camera_params
    name = "".join([chr(item) for item in name])
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 78, in <listcomp>
    name = "".join([chr(item) for item in name])
TypeError: only integer scalar arrays can be converted to a scalar index

I followed all the steps listed in the repository and got no errors while installing the requirements, I appreciate any help.

Shimingyi commented 3 years ago

Sorry I cannot reproduce your probelm here, can you check the version of python library h5py or maybe you can re-install it?

conda remove h5py
conda install -c anaconda h5py
Mingos390 commented 3 years ago

The version of the h5py library i have installed is the following.

mingos@mingos:~$ pip3 show h5py
Name: h5py
Version: 2.8.0
Summary: Read and write HDF5 files from Python
Home-page: http://www.h5py.org
Author: Andrew Collette
Author-email: andrew.collette@gmail.com
License: BSD
Location: /home/mingos/.local/lib/python3.8/site-packages
Requires: numpy, six
Required-by: 

I didn't use conda to install any of the packages, I used pip3, let me know if this causes any issues. I will now re-install the h5py library and update you on the results.

Shimingyi commented 3 years ago

pip3 should be fine. Let me know if there are any updates : )

Mingos390 commented 3 years ago

I re-installed the library unfortunately i get the same error message.

Shimingyi commented 3 years ago

I guess the problem is from some bad file, would you mind to add this line and let me know the output?

# h36m_utils.py, line 78
print(name)
name = "".join([chr(item) for item in name])
Mingos390 commented 3 years ago

I added the lines you asked to the file h36m_utils.py, this are the lines 77, 78 and 79 of the script.

    name = hf[path.format('Name')][:]
    print(name)
    name = "".join([chr(item) for item in name])

The new output is the following.

Building the network
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
Traceback (most recent call last):
  File "evaluate.py", line 137, in <module>
    main(config, args, output_folder)
  File "evaluate.py", line 73, in main
    parameters = [torch.from_numpy(np.array(item)).float().to(device) for item in h36m_loader(config, is_training=True).dataset.get_parameters()]
  File "/home/mingos/MotioNet/data/data_loaders.py", line 11, in __init__
    self.dataset = h36m_dataset.h36m_dataset(config, is_train=is_training)
  File "/home/mingos/MotioNet/data/h36m_dataset.py", line 14, in __init__
    self.cameras = h36m_utils.load_cameras('./data/cameras.h5')
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 98, in load_cameras
    R, T, f, c, k, p, name = load_camera_params(hf, 'subject%d/camera%d/{0}' % (s, c_idx + 1))
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 79, in load_camera_params
    name = "".join([chr(item) for item in name])
  File "/home/mingos/MotioNet/utils/h36m_utils.py", line 79, in <listcomp>
    name = "".join([chr(item) for item in name])
TypeError: only integer scalar arrays can be converted to a scalar index
Shimingyi commented 3 years ago

Can you try this line? name = "".join([chr(int(item[0])) for item in name])

Mingos390 commented 3 years ago

With that line this is the output.

Building the network
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
[[53.]
 [52.]
 [49.]
 [51.]
 [56.]
 [57.]
 [54.]
 [57.]]
[[53.]
 [53.]
 [48.]
 [49.]
 [49.]
 [50.]
 [55.]
 [49.]]
[[53.]
 [56.]
 [56.]
 [54.]
 [48.]
 [52.]
 [56.]
 [56.]]
[[54.]
 [48.]
 [52.]
 [53.]
 [55.]
 [50.]
 [55.]
 [52.]]
Killed
Shimingyi commented 3 years ago

yesyes, if the new line works well, you can delete the previous line print(name) becuase i just want to make sure the values are fine. It seems no problems now.

Mingos390 commented 3 years ago

The process is killed by the kernel for to much memory consumption, i used both the System monitor app and the command dmesg to confirm this, i believe this is because my machine is not powerful enough, especially my GPU , to run the network. Anyways i appreciate the help! :)

Shimingyi commented 3 years ago

I see : ( You can let me know if you have other question or need some help!