栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

猫和狗的分类例子-Kaggle

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

猫和狗的分类例子-Kaggle

# coding:utf8
from config import opt
import os
import torch as t
import models
from data.dataset import DogCat
from torch.utils.data import DataLoader
from torchnet import meter
from utils import Visualizer
from tqdm import tqdm
1、问题描述:

书籍上的代码例子,执行环境依赖库安装。

pip install -r requirements.txt

发现这句指令有错,pip install git+https://github.com/pytorch/tnt.git@master
安装依赖包torchnet:tnt。遇到如下错误:

PS D:PycharmProjectsclassic> pip install git+https://github.com/pytorch/tnt.git@master


Collecting git+https://github.com/pytorch/tnt.git@master
  Cloning https://github.com/pytorch/tnt.git (to revision master) to c:usersadministratorappdatalocaltemppip-req-build-j0h97qgi
  Running command git clone -q https://github.com/pytorch/tnt.git 'C:UsersAdministratorAppDataLocalTemppip-req-build-j0h97qgi'
  ERROR: Error [WinError 2] 系统找不到指定的文件。 while executing command git clone -q https://github.com/pytorch/tnt.git 'C:UsersAdministratorAppDataLocalTemppip-req-build-j0h97qgi'
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
 

2、解决办法:

1)主要是没有安装git包,执行命令: 

conda install git

 

2)完成安装git后,再次执行requirements中的指令,完成torchnet包的安装:

pip install git+https://github.com/pytorch/tnt.git@master

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/958312.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号