clean-pvnet: Uncertainty pnp import error

Hello, thanks for sharing your work. I got a little trouble on reproducing uncertainty pnp results. To use uncertainty pnp, I already installed libgoogle-glog-dev, libsuitesparse-dev and libatas-base-dev

~/Desktop/workspace/clean-pvnet/lib/csrc/uncertainty_pnp$ sudo apt-get install libatlas-base-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libatlas-base-dev is already the newest version (3.10.3-5).
The following packages were automatically installed and are no longer required:
  fonts-wine libfwup1 libllvm9 libllvm9:i386 libwine libwine:i386 ocl-icd-libopencl1:i386 wine32:i386 wine64
Use 'sudo apt autoremove' to remove them.
~/Desktop/workspace/clean-pvnet/lib/csrc/uncertainty_pnp$ sudo apt-get install libsuitesparse-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libsuitesparse-dev is already the newest version (1:5.1.2-2).
The following packages were automatically installed and are no longer required:
  fonts-wine libfwup1 libllvm9 libllvm9:i386 libwine libwine:i386 ocl-icd-libopencl1:i386 wine32:i386 wine64
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
~/Desktop/workspace/clean-pvnet/lib/csrc/uncertainty_pnp$ sudo apt-get install libgoogle-glog-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgoogle-glog-dev is already the newest version (0.3.5-1).
The following packages were automatically installed and are no longer required:
  fonts-wine libfwup1 libllvm9 libllvm9:i386 libwine libwine:i386 ocl-icd-libopencl1:i386 wine32:i386 wine64
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

For the build part, it gives a lot of warning, but i think i installed it successfully

.
.
.
./include/eigen3/Eigen/src/Core/AssignEvaluator.h:648:20:   required from ‘void Eigen::internal::call_dense_assignment_loop(const DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >; SrcXprType = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>; Functor = Eigen::internal::assign_op<double>]’
./include/eigen3/Eigen/src/Core/AssignEvaluator.h:790:31:   required from ‘static void Eigen::internal::Assignment<DstXprType, SrcXprType, Functor, Eigen::internal::Dense2Dense, Scalar>::run(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >; SrcXprType = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>; Functor = Eigen::internal::assign_op<double>; Scalar = double]’
./include/eigen3/Eigen/src/Core/AssignEvaluator.h:747:49:   required from ‘void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >; Src = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>; Func = Eigen::internal::assign_op<double>]’
./include/eigen3/Eigen/src/Core/AssignEvaluator.h:712:27:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&, const Func&, typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type) [with Dst = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >; Src = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>; Func = Eigen::internal::assign_op<double>; typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type = void*]’
./include/eigen3/Eigen/src/Core/AssignEvaluator.h:693:18:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >; Src = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>]’
./include/eigen3/Eigen/src/Core/Assign.h:66:28:   required from ‘Derived& Eigen::MatrixBase<Derived>::operator=(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Block<const Eigen::Matrix<double, 6, 1, 0, 6, 1>, 0, 1, false>; Derived = Eigen::Map<Eigen::Matrix<double, 0, 1, 0, 0, 1>, 0, Eigen::Stride<0, 0> >]’
./include/ceres/internal/autodiff.h:196:56:   required from ‘void ceres::internal::Take1stOrderPart(int, const JetT*, T*) [with JetT = ceres::Jet<double, 6>; T = double; int N0 = 6; int N = 0]’
./include/ceres/internal/autodiff.h:307:5:   required from ‘static bool ceres::internal::AutoDiff<Functor, T, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::Differentiate(const Functor&, const T* const*, int, T*, T**) [with Functor = ReprojectionErrorArray; T = double; int N0 = 6; int N1 = 0; int N2 = 0; int N3 = 0; int N4 = 0; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
./include/ceres/autodiff_cost_function.h:211:66:   required from ‘bool ceres::AutoDiffCostFunction<CostFunctor, kNumResiduals, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::Evaluate(const double* const*, double*, double**) const [with CostFunctor = ReprojectionErrorArray; int kNumResiduals = 2; int N0 = 6; int N1 = 0; int N2 = 0; int N3 = 0; int N4 = 0; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
src/uncertainty_pnp.cpp:156:1:   required from here
./include/eigen3/Eigen/src/Core/CoreEvaluators.h:697:8: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes]
generating ./_ext.c
(already up-to-date)
the current directory is '/home/nizar/Desktop/workspace/clean-pvnet/lib/csrc/uncertainty_pnp'
running build_ext
building '_ext' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/nizar/Desktop/workspace/clean-pvnet_env/include -I/home/nizar/.pyenv/versions/3.7.3/include/python3.7m -c _ext.c -o ./_ext.o
gcc -pthread -shared -L/home/nizar/.pyenv/versions/3.7.3/lib -L/home/nizar/.pyenv/versions/3.7.3/lib ./_ext.o src/uncertainty_pnp.cpp.o ./lib/libceres.so ./lib/libglog.so -lstdc++ -o ./_ext.cpython-37m-x86_64-linux-gnu.so

I still got the given above error.

~/Desktop/workspace/clean-pvnet$ python run.py --type evaluate --cfg_file configs/linemod.yaml model cat cls_type cat test.un_pnp True
Load model: data/model/pvnet/cat/199.pth
loading annotations into memory...
Done (t=0.05s)
creating index...
index created!
Traceback (most recent call last):
  File "run.py", line 226, in <module>
    globals()['run_'+args.type]()
  File "run.py", line 74, in run_evaluate
    evaluator = make_evaluator(cfg)
  File "/home/nizar/Desktop/workspace/clean-pvnet/lib/evaluators/make_evaluator.py", line 19, in make_evaluator
    return _evaluator_factory(cfg)
  File "/home/nizar/Desktop/workspace/clean-pvnet/lib/evaluators/make_evaluator.py", line 11, in _evaluator_factory
    evaluator = imp.load_source(module, path).Evaluator(cfg.result_dir)
  File "/home/nizar/.pyenv/versions/3.7.3/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "lib/evaluators/linemod/pvnet.py", line 13, in <module>
    from lib.csrc.uncertainty_pnp import un_pnp_utils
  File "/home/nizar/Desktop/workspace/clean-pvnet/lib/csrc/uncertainty_pnp/un_pnp_utils.py", line 1, in <module>
    from lib.csrc.uncertainty_pnp._ext import lib, ffi
ImportError: libspqr.so.2.0.2: cannot open shared object file: No such file or directory

Is there something i did wrong?

My setup: ubuntu18.04.4 LTS python 3.7.3

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Maybe you could try ubuntu 16.04.

Thanks!

Re compiling all the dependencies, I think i had make it work under ubuntu 18.04.

~/Desktop/workspace/clean-pvnet/lib/csrc/ransac_voting/ransac_voting_gpu.py:140: UserWarning: This overload of nonzero is deprecated:
        nonzero(Tensor input, *, Tensor out)
Consider using one of the following signatures instead:
        nonzero(Tensor input, *, bool as_tuple) (Triggered internally at  /pytorch/torch/csrc/utils/python_arg_parser.cpp:766.)
  coords = torch.nonzero(cur_mask).float()  # [tn,2]
~/Desktop/workspace/clean-pvnet/lib/csrc/ransac_voting/ransac_voting_gpu.py:142: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (Triggered internally at  /pytorch/aten/src/ATen/native/IndexingUtils.h:20.)
  direct = vertex[bi].masked_select(torch.unsqueeze(torch.unsqueeze(cur_mask, 2), 3))  # [tn,vn,2]
Segmentation fault (core dumped)

I keep getting this segmentation fault. Is there anything i can do about this?

You need to remove the build directory under lib/csrc/uncertainty_pnp before re-compiling it. The easiest way is changing ubuntu to 16.04.