Closed chx125ck closed 2 years ago
Hi, I just tried the example out and I didn't encounter the error except for the first one (c_idx
). Since the second error is from pytorch3d, I guess this might be a pytorch3d version problem. I am using pytorch3d 0.2.5 and maybe you can try that out?
Yes, regarding the second error, I was using pytorch3d 0.5.0 and changing to 0.2.5 solves the problem.
Any ideas on the other errors?
Hi, sorry for the late reply. I didn't encounter the error ERROR - Could not plot gradient: TypeError("transform_points_screen() got multiple values for argument 'eps'").
so I thought all other errors will be fixed by changing the version of pytorch3d
.
I check the environment.yml file and I believe pytorch3d 0.4.0
would be the version Yifan was using. But mine 0.2.5
seems to work as well.
For the error AttributeError: 'PointClouds3D' object has no attribute 'is_empty'
, I would suggest changing is_empty
to isempty()
as per pytorch3d doc.
For the error AttributeError: 'PointClouds3D' object has no attribute 'vertices'
, I would suggest changing np.array(pointcloud.vertices)[None, ...]
to pointcloud.points_padded()
as per pytorch3d doc and tensorboard doc.
For the last error, I modify the model_selection_metric
in default.yaml
to chamfer_point
and change the code in line 198 from
if model_selection_metric == 'chamfer':
to
if 'chamfer' in model_selection_metric:
The results look good to me. I will double check these modifications and push the fixes afterwards. Thanks for pointing these out!
Thank you
I also find several errors when running without -- tri_color_light,
Traceback (most recent call last):
File "scripts/create_mvr_data_from_mesh.py", line 199, in
and
Traceback (most recent call last):
File "scripts/create_mvr_data_from_mesh.py", line 199, in
and
Traceback (most recent call last):
File "scripts/create_mvr_data_from_mesh.py", line 199, in
and
Traceback (most recent call last):
File "scripts/create_mvr_data_from_mesh.py", line 199, in
Thanks for these! Sorry our code is little bit messy as we were merging it from our dev version. Will fix these bugs when my GPU is idle :)
When running python scripts/create_mvr_data_from_mesh.py --points example_data/mesh/yoga6.ply --output example_data/images --num_cameras 128 --image-size 512 --tri_color_light --point_lights --has_specular, the following error pops up. Traceback (most recent call last): File "scripts/create_mvr_data_from_mesh.py", line 190, in
for c_idx, cams in tqdm(camera_sampler):
ValueError: too many values to unpack (expected 2)
The error above was fixed by removing c_idx, then the following error pops up.
Traceback (most recent call last): File "scripts/create_mvr_data_from_mesh.py", line 206, in
images = renderer.shader(
File "/home/chx/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/chx/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/renderer/mesh/shader.py", line 377, in forward
images = hard_rgb_blend(colors, fragments, blend_params)
File "/home/chx/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/renderer/blending.py", line 77, in hard_rgb_blend
return torch.cat([pixel_colors, alpha], dim=-1) # (N, H, W, 4)
RuntimeError: Tensors must have same number of dimensions: got 4 and 5
The error was caused by the ambient color of the light created by get_tri_color_lights_for_view in common.py having one more dimension and can be solved by reducing one dimension of the ambient color.
When running python train_mvr.py --config configs/dss.yml, the error pops up in the log ERROR - Could not plot gradient: TypeError("transform_points_screen() got multiple values for argument 'eps'"). The error is fixed by replacing pts_ndc = _cams.transform_points_screen(pts_world.view( 1, -1, 3), ((W, H),), eps=1e-17).view(-1, 3)[..., :2] pts_grad_ndc = _cams.transform_points_screen( (pts_world + pts_world_grad).view(1, -1, 3), ((W, H),), eps=1e-8).view(-1, 3)[..., :2] at line 531 in trainer.py with pts_ndc = _cams.transform_points_screen(pts_world.view( 1, -1, 3), eps=1e-17, image_size=((W, H),)).view(-1, 3)[..., :2] pts_grad_ndc = _cams.transform_points_screen( (pts_world + pts_world_grad).view(1, -1, 3), eps=1e-8, image_size=((W, H),)).view(-1, 3)[..., :2]
Then the following error appears, Traceback (most recent call last): File "train_mvr.py", line 199, in
eval_dict = trainer.evaluate_3d(
File "/home/chx/Forest/DSS/DSS/training/trainer.py", line 167, in evaluate_3d
if not pointcloud.is_empty:
AttributeError: 'PointClouds3D' object has no attribute 'is_empty'
and after defining is_empty for PointClouds3D in cloud.py, Traceback (most recent call last): File "train_mvr.py", line 199, in
eval_dict = trainer.evaluate_3d(
File "/home/chx/Forest/DSS/DSS/training/trainer.py", line 169, in evaluate_3d
np.array(pointcloud.vertices)[None, ...], global_step=it)
AttributeError: 'PointClouds3D' object has no attribute 'vertices'
which I solved by defining vertices to be "points" that is passed into the constructor of PointCloud3D and I am unsure whether that is correct.
After fixing the errors above, the following error appears, Traceback (most recent call last): File "train_mvr.py", line 205, in
metric_val = eval_dict[model_selection_metric]
KeyError: 'chamfer'
I printed out eval_dict {'chamfer_point': 0.027734989300370216, 'chamfer_normal': 0.5018584728240967} and I am not sure how to fix this.