Giter Club home page Giter Club logo

Comments (13)

biyuehuang avatar biyuehuang commented on September 13, 2024 1

I met the same problem. I want to convert yolact_plus to onnx.

import DCNv2
def evalimage(net:Yolact, path:str, save_path:str=None):
    frame = torch.from_numpy(cv2.imread(path)).float()
    batch = FastBaseTransform()(frame.unsqueeze(0))
    preds = net(batch)
    torch.onnx.export(net, batch, "yolact_plus.onnx",operator_export_type=DCNv2)

Error

Multiple GPUs detected! Turning off JIT.
Config not specified. Parsed yolact_plus_base_config from the file name.

Loading model... Done.
/home/kiwi/Document/yolact/DCNv2/dcn_v2.py:31: 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!
ctx.deformable_groups)
/home/kiwi/Document/yolact/yolact.py:221: TracerWarning: Converting a tensor to a Python boolean 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!
if self.last_img_size != (cfg._tmp_img_w, cfg._tmp_img_h):
Traceback (most recent call last):
File "eval.py", line 1123, in
evaluate(net, dataset)
File "eval.py", line 895, in evaluate
evalimage(net, args.image)
File "eval.py", line 609, in evalimage
torch.onnx.export(net, batch, "yolact_plus.onnx",operator_export_type=DCNv2)
File "/home/kiwi/miniconda3/envs/detectron2/lib/python3.6/site-packages/torch/onnx/init.py", line 148, in export
strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
File "/home/kiwi/miniconda3/envs/detectron2/lib/python3.6/site-packages/torch/onnx/utils.py", line 66, in export
dynamic_axes=dynamic_axes, keep_initializers_as_inputs=keep_initializers_as_inputs)
File "/home/kiwi/miniconda3/envs/detectron2/lib/python3.6/site-packages/torch/onnx/utils.py", line 416, in _export
fixed_batch_size=fixed_batch_size)
File "/home/kiwi/miniconda3/envs/detectron2/lib/python3.6/site-packages/torch/onnx/utils.py", line 296, in _model_to_graph
fixed_batch_size=fixed_batch_size, params_dict=params_dict)
File "/home/kiwi/miniconda3/envs/detectron2/lib/python3.6/site-packages/torch/onnx/utils.py", line 135, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
TypeError: _jit_pass_onnx(): incompatible function arguments. The following argument types are supported:
1. (arg0: torch::jit::Graph, arg1: torch._C._onnx.OperatorExportTypes) -> torch::jit::Graph

from dcnv2.

joyyang1215 avatar joyyang1215 commented on September 13, 2024

Same requirements. Thanks

from dcnv2.

lucasjinreal avatar lucasjinreal commented on September 13, 2024
RuntimeError: ONNX export failed: Couldn't export Python operator _DCNv2

from dcnv2.

universebang avatar universebang commented on September 13, 2024
RuntimeError: ONNX export failed: Couldn't export Python operator _DCNv2

same error, did u resolve it?

from dcnv2.

huaze555 avatar huaze555 commented on September 13, 2024

@jinfagang Hi, have you get some answer to solve this problem?

from dcnv2.

GilbertTam avatar GilbertTam commented on September 13, 2024

+1

from dcnv2.

iamZe avatar iamZe commented on September 13, 2024

Any updates?

from dcnv2.

EphChem avatar EphChem commented on September 13, 2024

+1

from dcnv2.

leon5678 avatar leon5678 commented on September 13, 2024

+1

from dcnv2.

wanghaohw avatar wanghaohw commented on September 13, 2024

@dheerajpreddy ,have you sloved your problems?I meet the same problem,I would be grateful you could give any information.

from dcnv2.

hitbuyi avatar hitbuyi commented on September 13, 2024

Any information or progress on this issue? I have same requirement to convert DCNv2 to ONNX

from dcnv2.

aRibra avatar aRibra commented on September 13, 2024

+1

from dcnv2.

Note-Liu avatar Note-Liu commented on September 13, 2024

+1

from dcnv2.

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.