Python 出现依赖性问题时,最好同时安装scikit learn和jupyter notebook。
诀窍是转到PyTorch并选择您需要的东西:Python 出现依赖性问题时,最好同时安装scikit learn和jupyter notebook。,python,windows,anaconda,pytorch,conda,Python,Windows,Anaconda,Pytorch,Conda,诀窍是转到PyTorch并选择您需要的东西: 如果您试图在windows 10上安装,但没有安装anaconda,那么最好的选项如下: Python 2.7 如果上面的命令不起作用,那么您有Python2.7UCS2,请使用此命令 pip install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp27-cp27m-linux_x86_64.whl Python 3.5 Python 3.6 Python 3.7 试试这个 cd C:\
如果您试图在windows 10上安装,但没有安装anaconda,那么最好的选项如下: Python 2.7 如果上面的命令不起作用,那么您有Python2.7UCS2,请使用此命令
pip install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp27-cp27m-linux_x86_64.whl
Python 3.5
Python 3.6
Python 3.7
试试这个
对于python 3.7,它是迄今为止最新的版本 对于cpu上的Pytork
pip安装https://download.pytorch.org/whl/cpu/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip安装torchvision
尝试运行:
conda install -c pytorch pytorch
该命令将更新/安装:conda、cudatoolkit、pytorch。pip install torch==1.5.0+cpu torchvision==0.6.0+cpu-f我使用的是官方网站(),其中提到了针对Windows 10和conda环境的以下命令: conda安装pytorch torchvision cudatoolkit=10.2-c pytorch 我在Anaconda命令提示符下运行了这个命令,但由于出现以下错误,我被卡住了 错误conda.core.link:_execute(502):卸载包“defaults::pycurl-7.43.0.1-py36h74b6da3_0”时出错。 WindowsError(5,“访问被拒绝”) 为了纠正这个问题,我以管理员身份打开了Anaconda命令提示符,然后再次运行相同的命令。它解决了访问问题并允许安装包 因此,您只需使用以下两个步骤: 步骤1:以管理员身份打开Anaconda提示符 步骤2:运行以下命令 conda安装pytorch torchvision cudatoolkit=10.2-c pytorch
以下是工作配置: Python 3.8 Pytorch版本1.5.1 视窗10 pytorch安装命令:
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch -c defaults -c numba/label/dev
错误是什么?注意:没有理由依赖这里的答案,您可以在找到安装说明。是的,它帮助我在官方网站上设置了你需要的设置,并复制了相应的命令来安装PyTorch。你为什么要在没有CUDA的情况下安装?@Lucas如果他没有GPU怎么办?它不能在没有沉重的“conda”框架的情况下安装吗?@PhilMacKay它不能在没有沉重的“conda”框架的情况下安装吗?Conda不是特别重,我想你指的是Anaconda?pip3安装torchvision的作用是什么?嗨,你能帮我在Win32位上安装pytorch吗?他们说他们不支持win32bit…这才是真正的答案。我想你应该用红色圈出“运行这个命令”。我之前在看一个链接或者其他更明显的东西,但是我把命令直接放到了我的脸上,哈哈。但是如果你像我一样创建了一个新的康达环境,它就不会工作了。什么意思?为什么需要手动安装这些依赖项?您没有安装anaconda,这是什么意思?这意味着您的计算机上没有安装anaconda发行版。OP显然在使用anaconda/Conda,因此,此解决方案并不好。您不需要为此使用pip。这已过时。这已过时。这已过时。谢谢您更新您的答案!:)为什么要更改目录?因为conda可能不在路径中
conda update conda
conda install -c peterjc123 pytorch_legacy cuda80
conda install -c peterjc123 pytorch
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip3 install torchvision
"""
import gym
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple
from itertools import count
from PIL import Image
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as T
env = gym.make('CartPole-v0').unwrapped
# set up matplotlib
is_ipython = 'inline' in matplotlib.get_backend()
if is_ipython:
from IPython import display
plt.ion()
# if gpu is to be used
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
######################################################################
# Replay Memory
# -------------
#
# We'll be using experience replay memory for training our DQN. It stores
# the transitions that the agent observes, allowing us to reuse this data
# later. By sampling from it randomly, the transitions that build up a
# batch are decorrelated. It has been shown that this greatly stabilizes
# and improves the DQN training procedure.
#
# For this, we're going to need two classses:
#
# - ``Transition`` - a named tuple representing a single transition in
# our environment. It maps essentially maps (state, action) pairs
# to their (next_state, reward) result, with the state being the
# screen difference image as described later on.
# - ``ReplayMemory`` - a cyclic buffer of bounded size that holds the
# transitions observed recently. It also implements a ``.sample()``
# method for selecting a random batch of transitions for training.
#
Transition = namedtuple('Transition',
('state', 'action', 'next_state', 'reward'))
class ReplayMemory(object):
def __init__(self, capacity):
self.capacity = capacity
self.memory = []
self.position = 0
def push(self, *args):
"""Saves a transition."""
if len(self.memory) < self.capacity:
self.memory.append(None)
self.memory[self.position] = Transition(*args)
self.position = (self.position + 1) % self.capacity
def sample(self, batch_size):
return random.sample(self.memory, batch_size)
def __len__(self):
return len(self.memory)
############continues to line 507...
pip install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
pip install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp27-cp27m-linux_x86_64.whl
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
conda install -c pytorch pytorch
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch -c defaults -c numba/label/dev