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

'no attribute ndim' #21

Open
g30ba1 opened this issue Jun 22, 2020 · 3 comments
Open

'no attribute ndim' #21

g30ba1 opened this issue Jun 22, 2020 · 3 comments

Comments

@g30ba1
Copy link

g30ba1 commented Jun 22, 2020

I was able to download the three files required by align_face.py and PULSE.py, then I was able to downsample 3 images with no problem, but when I try to run "run.py", I get an error:

Loading Synthesis Network
Downloading https://drive.google.com/uc?id=1xKDEzjfGPa1s1iDYucH4eSxLvl1MuLE1 ... done
Traceback (most recent call last):
File "run.py", line 79, in
for j,(HR,LR) in enumerate(model(ref_im,**kwargs)):
File "/home/pyimagesearch/Downloads/pulse-master/PULSE.py", line 114, in forward
opt = SphericalOptimizer(opt_func, var_list, lr=learning_rate)
File "/home/pyimagesearch/Downloads/pulse-master/SphericalOptimizer.py", line 17, in init
self.radii = {param: (param.pow(2).sum(tuple(range(2,param.ndim)),keepdim=True)+1e-9).sqrt() for param in params}
File "/home/pyimagesearch/Downloads/pulse-master/SphericalOptimizer.py", line 17, in
self.radii = {param: (param.pow(2).sum(tuple(range(2,param.ndim)),keepdim=True)+1e-9).sqrt() for param in params}
AttributeError: 'Tensor' object has no attribute 'ndim'


I´m using a Jetson Nano, with CUDA and all the modules and dependences required by the program.

Some tip?

@bmdisbrow
Copy link

Try uninstalling and re-installing pytorch again.

@bmdisbrow
Copy link

conda uninstall pytorch
pip uninstall torch
pip uninstall torch # run this command twice
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

@rockjicks
Copy link

I Replace param.ndim to len(list(param.size()) in SphericalOptimizer.py
it worked well

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

3 participants