Giter Site home page Giter Site logo

centernet2torchscript's People

Contributors

xi11xi19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

centernet2torchscript's Issues

Cannot compile

I try to compile dcn_v2_cuda_forward_v2, here is my specs:

CUDA Version: 10.1
PyTorch Version: 1.4
Operating System: Ubuntu 18.04
GPU: GTX1050m

I got error

candidate: constexpr torch::jit::RegisterOperators::RegisterOperators(torch::jit::RegisterOperators&&)
/usr/lib/libtorch_abi11_14/include/torch/csrc/jit/custom_operator.h:16:18: note:   candidate expects 1 argument, 2 provided
CMakeFiles/dcn_v2_cuda_forward_v2.dir/build.make:1509: recipe for target 'CMakeFiles/dcn_v2_cuda_forward_v2.dir/vision.cpp.o' faile

convert failed

thanks for you work,I failed as follows,
traced_script_module = torch.jit.trace(model, example)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 882, in trace
check_tolerance, _force_outplace, _module_class)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1028, in trace_module
module = make_module(mod, _module_class, _compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1836, in init
tmp_module._modules[name] = make_module(submodule, TracedModule, _compilation_unit=None)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1836, in init
tmp_module._modules[name] = make_module(submodule, TracedModule, _compilation_unit=None)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1836, in init
tmp_module._modules[name] = make_module(submodule, TracedModule, _compilation_unit=None)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1836, in init
tmp_module._modules[name] = make_module(submodule, TracedModule, _compilation_unit=None)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1836, in init
tmp_module._modules[name] = make_module(submodule, TracedModule, _compilation_unit=None)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 727, in make_module
return _module_class(mod, _compilation_unit=_compilation_unit)
File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/init.py", line 1809, in init
assert(isinstance(orig, torch.nn.Module))
AssertionError

Abnormal debug message when covert model to pt file.

Hi, xi11xi19:
I used your sample code and tried to convert dla34 model to pt file, but it will output below abnormal message:
D:\ML\C\CenterNet2TorchScript-master\DCNv2\dcn_v2.py:93: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
self.deformable_groups)
Could you help to support this problem?
Thanks a lot.

error: ‘RegisterOperators’ is not a member of ‘torch::jit’

Hi folks,
ubuntu 16.04+cuda11.0+pytorch1.7.1, I can not compile this repository, so I download lbin's DCNv2, https://github.com/lbin/DCNv2
Add modified some file acc. to this repository, such as add dcn_v2_cuda_forward_v2 in dcn_v2_cuda.cu and accordingly in vision.h, add keep vision.cpp the same as this repository
And I got this error when run make.sh
/vision.cpp:5:5: error: ‘RegisterOperators’ is not a member of ‘torch::jit’
torch::jit::RegisterOperators("my_ops::dcn_v2_cuda_forward_v2", &dcn_v2_cuda_forward_v2);

looks like pytorch 1.7.1 not support torch::jit::registerOperators
So which func in torch1.7.1 can take place of torch::jit::registerOperators?
Any help will be appreciated!

error: no matching function for call

Hi, I'm able to compile https://github.com/CharlesShang/DCNv2 fine, but when I try to compile this version I get the following error:

DCNv2/src/vision.cpp:12:92: error: no matching function for call to \u2018torch::jit::RegisterOperators::RegisterOperators(const char [31], at::Tensor (*)(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t))\u2019
	  torch::jit::RegisterOperators("my_ops::dcn_v2_cuda_forward_v2", &dcn_v2_cuda_forward_v2);
																														  ^
In file included from /usr/local/lib/python3.7/dist-packages/torch/include/torch/script.h:6:0,
					  from /CenterTrack/src/lib/model/networks/DCNv2/src/vision.cpp:3:
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:20:3: note: candidate: torch::jit::RegisterOperators::RegisterOperators(std::vector<torch::jit::Operator>)
	RegisterOperators(std::vector<Operator> operators) {
	^~~~~~~~~~~~~~~~~
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:20:3: note:   candidate expects 1 argument, 2 provided
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:17:3: note: candidate: constexpr torch::jit::RegisterOperators::RegisterOperators()
	RegisterOperators() = default;
	^~~~~~~~~~~~~~~~~
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:17:3: note:   candidate expects 0 arguments, 2 provided
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:16:18: note: candidate: constexpr torch::jit::RegisterOperators::RegisterOperators(const torch::jit::RegisterOperators&)
 struct TORCH_API RegisterOperators {
						^~~~~~~~~~~~~~~~~
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:16:18: note:   candidate expects 1 argument, 2 provided
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:16:18: note: candidate: constexpr torch::jit::RegisterOperators::RegisterOperators(torch::jit::RegisterOperators&&)
/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/jit/custom_operator.h:16:18: note:   candidate expects 1 argument, 2 provided
/CenterTrack/src/lib/model/networks/DCNv2/src/vision.cpp:11:13: warning: \u2018registry\u2019 defined but not used [-Wunused-variable]
 static auto registry =
				 ^~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Happen to know how I can solve this?

Edit: should this be compatible with torch 1.4.0?
I think for later versions in src/vision.cpp torch::jit::RegisterOperator() should change to torch::RegisterOperators()

Unknown builtin op: my_ops::dcn_v2_cuda_forward_v2.

hi xi11xi19,
i use your code and had convert .pth to .pt
then i want to test the .pt file, use :
module = torch::jit::load()
to load this model, i met this error:

terminate called after throwing an instance of 'torch::jit::script::ErrorReport'
what():
Unknown builtin op: my_ops::dcn_v2_cuda_forward_v2.
Could not find any similar ops to my_ops::dcn_v2_cuda_forward_v2. This op may not exist or may not be currently supported in TorchScript.

can i get some help, thanks

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.