ethnhe / PVN3D

Code for "PVN3D: A Deep Point-wise 3D Keypoints Hough Voting Network for 6DoF Pose Estimation", CVPR 2020
MIT License
488 stars 105 forks source link

TypeError: step() missing 1 required positional argument: 'step' #69

Closed MY-CODE-1981 closed 3 years ago

MY-CODE-1981 commented 3 years ago

1.5 is better than tourch 1.0. closed past issues would be helpful much more.

ethnhe commented 3 years ago

There are some changes on the _LRScheduler class after Pytorch version 1.0. If you are using a version higher than that, use the CyclicLR in the torch.optim.lr_scheduler module (link1, link2) as in our pytorch-1.5 branch.

ethnhe commented 3 years ago

I tested the torch-1.5 branch and it's working well. If you use pytorch1.5, just use the CyclicLR implemented by PyTorch link, following their documentation as we did in the pytorch-1.5 branch, not the one we implemented in lib/utils/clr_callback.py, which works well in torch=1.0 while not in version higher than 1.0.

ethnhe commented 3 years ago

Thanks for the advice, I'll check them when I have more spare time. You're also welcome to commit a pull request :)

ethnhe commented 3 years ago

The _ext and step() issue have been asked several times in the past by difference persons, but you have not provided any specific answers and realistic fixes. It seems to be as if you avoid to give direct answers.

In fact, the problem is only caused by torch version > 1.0 and the problem in the train_linemod_pvn3d.py have been fixed in the PyTorch-1.5 branch several months ago. As the first two links (link1, link2) I've provided before:

There are some changes on the _LRScheduler class after Pytorch version 1.0. If you are using a version higher than that, use the CyclicLR in the torch.optim.lr_scheduler module (link1, link2) as in our pytorch-1.5 branch.

While the script train_ycb_pvn3d.py wasn't updated in that branch and I'll update it.

ethnhe commented 3 years ago

your pointnet2_utils folder does not contain _ext. your code must be changed from "from lib.pointnet2_utils import _ext" to "import pointnet2_ops._ext as _ext", futhermore, init.py should remove the line of "from . import _ext". Maybe, I recommend you find out how to install the libraries you need, starting from the fact that none of them are installed.

If you follow the instruction in our readme and build the pointnet2 ext using scripts in PVN3D/setup.py rather than those in Pointnet2_PyTorch,

cd Pointnet2_PyTorch
pip3 install -r requirements.txt
cd ..     # go back to the PVN3D folder
python3 setup.py build_ext   # execute script PVN3D/setup.py

one copy of the built _ext*.so will be copied to pointnet2_utils folder, as show in the code