Coder Social home page Coder Social logo

Comments (13)

zztianzz avatar zztianzz commented on August 19, 2024

Hi, the code can be runned now. Please try again~

from pf-net-point-fractal-network.

huanlede avatar huanlede commented on August 19, 2024

Hi, Thanks for your work. I met the same problem.

Traceback (most recent call last):
File "/home/coding/pcl/PF-Net-Point-Fractal-Network-master/Train_PFNet.py", line 218, in
output = point_netD(real_center)
File "/home/anaconda3/envs/pfnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/anaconda3/envs/pfnet/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 141, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/anaconda3/envs/pfnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/coding/pcl/PF-Net-Point-Fractal-Network-master/model_PFNet.py", line 196, in forward
x = torch.cat(Layers,1)
RuntimeError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

I just download the newest code, but it still can't work.

from pf-net-point-fractal-network.

zztianzz avatar zztianzz commented on August 19, 2024

Please print the size of real_center and tell me. It seem that the size of real_center is not match. Size of real_center should be [B,1,num_point,3]

from pf-net-point-fractal-network.

huanlede avatar huanlede commented on August 19, 2024

from pf-net-point-fractal-network.

zztianzz avatar zztianzz commented on August 19, 2024

The problem is in model_PFNet.py which may happened when the last batchsize is 1:
192 x_64 = torch.squeeze(self.maxpool(x_64))
193 x_128 = torch.squeeze(self.maxpool(x_128))
194 x_256 = torch.squeeze(self.maxpool(x_256))
It will squeeze all dimension which size is 1. ([1,1,512,3]->[512,3])
change the code into:
192 x_64 = torch.squeeze(self.maxpool(x_64),1)
193 x_128 = torch.squeeze(self.maxpool(x_128),1)
194 x_256 = torch.squeeze(self.maxpool(x_256),1)
If it works, please sent an email to me so that i can fix the code. Thx

from pf-net-point-fractal-network.

huanlede avatar huanlede commented on August 19, 2024

from pf-net-point-fractal-network.

zztianzz avatar zztianzz commented on August 19, 2024

change the code into:
192 x_64 = torch.squeeze(self.maxpool(x_64),2)
193 x_64 = torch.squeeze(self.maxpool(x_64),2)
194 x_128 = torch.squeeze(self.maxpool(x_128),2)
195 x_128 = torch.squeeze(self.maxpool(x_128),2)
196 x_256 = torch.squeeze(self.maxpool(x_256),2)
197 x_256 = torch.squeeze(self.maxpool(x_256),2)
let [1,dim,1,1]->[1,dim]
try again,thx

from pf-net-point-fractal-network.

huanlede avatar huanlede commented on August 19, 2024

from pf-net-point-fractal-network.

zztianzz avatar zztianzz commented on August 19, 2024

'I think adjusting the number of batch size would be better.'
It is also a temporary way. I will try to fix it...

from pf-net-point-fractal-network.

Jing-lun avatar Jing-lun commented on August 19, 2024

Hi @zztianzz @huanlede, I met the same issues as yours, I was wondering how did you guys fix finally them?

from pf-net-point-fractal-network.

Jing-lun avatar Jing-lun commented on August 19, 2024

Hi @zztianzz @huanlede, I met the same issues as yours, I was wondering how did you guys fix finally them?

I have to crop the dataset and let its size fits with the batchsize...then the network could run. Not a good idea, however, the author still not update the repo, maybe right now one could have a try on this way, add code to shapenet_part_loader.py:
(after generating self.datapath)

for i in range(len(self.datapath)%32):
            self.datapath.pop()

from pf-net-point-fractal-network.

zztianzz avatar zztianzz commented on August 19, 2024

The problem may come from 'torch.squeeze'(without pointing out the dim) which may kill all the dim 1. If the final batchsize is 1,this bug may happen.

from pf-net-point-fractal-network.

Jing-lun avatar Jing-lun commented on August 19, 2024

The problem may come from 'torch.squeeze'(without pointing out the dim) which may kill all the dim 1. If the final batchsize is 1,this bug may happen.

Yeah it is so that I was asking if there are some other ways to fix this issue other than limit the size of dataset to the multiples of the size of batchsize.

from pf-net-point-fractal-network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.