OFA-Sys / Chinese-CLIP

Chinese version of CLIP which achieves Chinese cross-modal retrieval and representation generation.
MIT License
4.58k stars 473 forks source link

进行 rn50 model-arch 转 onnx 的时候会报如下错误 #337

Open pisces365 opened 3 months ago

pisces365 commented 3 months ago

进行 rn50 model-arch 转 onnx 的时候会报如下错误: Traceback (most recent call last): File "/data/yjn/anaconda3/envs/lmdrive/lib/python3.8/site-packages/torch/onnx/utils.py", line 1703, in _export _C._check_onnx_proto(proto) RuntimeError: Unrecognized attribute: axes for operator ReduceMean

==> Context: Bad node spec for node. Name: /visual/attnpool/ReduceMean OpType: ReduceMean

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "cn_clip/deploy/pytorch_to_onnx.py", line 139, in torch.onnx.export(model, File "/data/yjn/anaconda3/envs/lmdrive/lib/python3.8/site-packages/torch/onnx/utils.py", line 516, in export _export( File "/data/yjn/anaconda3/envs/lmdrive/lib/python3.8/site-packages/torch/onnx/utils.py", line 1705, in _export raise errors.CheckerError(e) from e torch.onnx.errors.CheckerError: Unrecognized attribute: axes for operator ReduceMean

==> Context: Bad node spec for node. Name: /visual/attnpool/ReduceMean OpType: ReduceMean

请问应该如何解决,谢谢!

pisces365 commented 3 months ago

另:是否有转换好的onnx模型能够提供下载呢