猫和狗的分类例子-Kaggle

44 篇文章 4 订阅

# 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:\PycharmProjects\classic> 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:\users\administrator\appdata\local\temp\pip-req-build-j0h97qgi
  Running command git clone -q https://github.com/pytorch/tnt.git 'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-j0h97qgi'
  ERROR: Error [WinError 2] 系统找不到指定的文件。 while executing command git clone -q https://github.com/pytorch/tnt.git 'C:\Users\Administrator\AppData\Local\Temp\pip-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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值