pytorch 环境使用问题汇总

文章提供了解决tensorboard运行时AttributeError的方法,问题由setuptools版本过高引起,建议降级到58.0.4版本。同时指导如何安装opencv-python、protobuf特定版本以及pycocotools,包括对pycocotools的Windows特定安装步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. tensorboard 无法使用

  • 问题描述:
    控制台输入 tensorboard --logdir
    显示 AttributeError: module 'distutils' has no attribute 'version'

  • 解决办法:
    能见到这个提示,说明tensorboard安装没问题
    setuptools 版本过高导致的问题
    第一步:卸载 pip uninstall setuptools (必须用pip卸载)
    第二步:安装指定版本 pip或者conda install setuptools==58.0.4
    参考链接:链接

2. opencv-python 高版本安装

  • pip install opencv-python -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

3. protobuf 版本不对

  • pip install protobuf==3.19.0

4. pycocotools 安装

  • 先安装VC 环境, 重启电脑
  • 安装 pip install pycocotools-windows -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 安装 pip install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值