torch转ONNX:_any() takes 2 positional arguments but 4 were given

TypeError: _any() takes 2 positional arguments but 4 were given 
(Occurred when translating any).

大家肯定看到过这个文章:

https://github.com/pytorch/pytorch/issues/65817

https://blog.csdn.net/andrewchen1985/article/details/125197226

直接升级torch吧,我原来是1.9会报这个错,升到1.13就好了,1.13的源码里是不用改的。

dockerfile如下:

# python: 3.9
FROM pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel

RUN echo "" > /etc/apt/sources.list.d/cuda.list
RUN sed -i "s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g" /etc/apt/sources.list
RUN sed -i "s@/security.ubuntu.com/@/mirrors.aliyun.com/@g" /etc/apt/sources.list
RUN apt-get update --fix-missing && apt-get install -y fontconfig --fix-missing
RUN apt-get install -y cmake
RUN apt-get install -y vim

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scipy matplotlib seaborn h5py sklearn numpy==1.20.3 pandas==1.3.5

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ftfy==6.1.1 jieba==0.42.1
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorboardX==2.5.1 tensorboard==2.11.0
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple datasets==2.7.1 protobuf==3.20.1

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple huggingface_hub==0.11.1 transformers==4.25.1
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple diffusers==0.9.0
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple accelerate==0.15.0 modelcards==0.1.6

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pytorch_lightning==1.8.1
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple lightning==1.8.1
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple deepspeed==0.7.6
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple onnx==1.12.0 onnxruntime-gpu==1.13.1

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple markupsafe==2.0.1

WORKDIR /home
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WGS.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值