Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: Input Error: Only 3D, 4D and 5D input Tensors supported (got 3D) for the modes: nearest | linear | bilinear | bicubic | trilinear (got bicubic) #40

Closed
hfarhidzadeh opened this issue Jul 23, 2020 · 4 comments

Comments

@hfarhidzadeh
Copy link

Hi @shunsukesaito

I could run the code on colab on my test data and worked fine. I am trying to run it on gpu machine getting this following error.

Traceback (most recent call last):
File "/home/hamid_farhid/anaconda3/envs/PIFuHD/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/hamid_farhid/anaconda3/envs/PIFuHD/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/hamid_farhid/PIFuHD/pifuhd/apps/simple_test.py", line 30, in
reconWrapper(cmd, args.use_rect)
File "/home/hamid_farhid/PIFuHD/pifuhd/apps/recon.py", line 220, in reconWrapper
recon(opt, use_rect)
File "/home/hamid_farhid/PIFuHD/pifuhd/apps/recon.py", line 210, in recon
gen_mesh(opt.resolution, netMR, cuda, test_data, save_path, components=opt.use_compose)
File "/home/hamid_farhid/PIFuHD/pifuhd/apps/recon.py", line 38, in gen_mesh
net.filter_global(image_tensor_global)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGPIFuMRNet.py", line 83, in filter_global
self.netG.filter(images)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGPIFuNetwNML.py", line 134, in filter
self.im_feat_list, self.normx = self.image_filter(images)
File "/home/hamid_farhid/anaconda3/envs/PIFuHD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGFilters.py", line 195, in forward
hg = self._modules'm' + str(i)
File "/home/hamid_farhid/anaconda3/envs/PIFuHD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGFilters.py", line 117, in forward
return self._forward(self.depth, x)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGFilters.py", line 103, in _forward
low2 = self._forward(level - 1, low1)
File "/home/hamid_farhid/PIFuHD/pifuhd/lib/model/HGFilters.py", line 111, in _forward
up2 = F.interpolate(low3, scale_factor=2, mode='bicubic', align_corners=True)
File "/home/hamid_farhid/anaconda3/envs/PIFuHD/lib/python3.7/site-packages/torch/nn/functional.py", line 2459, in interpolate
" (got {})".format(input.dim(), mode))
NotImplementedError: Input Error: Only 3D, 4D and 5D input Tensors supported (got 4D) for the modes: nearest | linear | bilinear | trilinear (got bicubic)
freeglut (foo): failed to open display ''

By referencing this: Error, we should do some changes on input tensor. Any thought on this one?

@shunsukesaito
Copy link
Contributor

Can you make sure you use the latest version of pytorch?

@hfarhidzadeh
Copy link
Author

@shunsukesaito Thank you. I updated the version of pytorch. I ran to new issue when I rum demo.sh on remote desktop
Warning: opt is overwritten. test data size: 0 initialize network with normal initialize network with normal generate mesh (test) ... 0it [00:00, ?it/s]

@shunsukesaito
Copy link
Contributor

Seems like files under the folder is not recognized. Do you put PNG/JPG files together with "{file_name}_keypoints.json" or "{file_name}_rect.txt"? Please check if the code works first with the provided sample image.

@shunsukesaito
Copy link
Contributor

I will close the issue. Please reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants