001.Pytorch框架CV开发(环境安装)

1.安装环境

opencv 下载
pip install opencv-python==4.7.0.72
pip install openvino==2023.0.0

pytorch 模型下载(https://pytorch.org/get-started/previous-versions/)

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118


onnxruntime 模型下载
pip install onnxruntime-gpu==1.15

2.验证环境

import cv2 as c
import  torch as t

print(t.__version__)
print(c.__version__)

3.遇到的问题

问题描述:
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2.

这是python 库numpy2.x和opencv的不兼容(不要下载最新版本!!)

解决方案:

pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy==1.23.5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值