将特定版本的PyTorch安装到conda环境

时间:2020-01-25 20:59:21

标签: virtualenv pytorch conda

我使用Anaconda Navigator创建了一个新环境,用于使用Python 3.6和PyTorch 0.4.0在VAE上运行某人的GitHub代码。不幸的是,Anaconda Navigator不能让我选择在此环境中安装旧版本的PyTorch,而只能选择我当前安装的PyTorch版本。如何仅将PyTorch 0.4.0安装到我创建的这个新Conda environment上?如果可以通过Anaconda Navigator,那就太好了!但是我认为这将通过Conda command完成。我绝对不想弄乱我的其他环境。

谢谢!

2 个答案:

答案 0 :(得分:2)

只需导航到要安装它的conda环境,然后使用

conda install pytorch = 0.4.1 -c pytorch

有关如何安装以前的PyTorch版本的更多详细信息,在这里:https://pytorch.org/get-started/previous-versions/

根据此博客,conda导航器不起作用,但是您可以按照它在conda环境中安装pytorch: https://medium.com/@bryant.kou/how-to-install-pytorch-on-windows-step-by-step-cc4d004adb2a

答案 1 :(得分:1)

如果您还想指定 cuda 版本,请执行以下操作:

create table Veggies
(
  num integer,
  emotion varchar(10),
  food varchar(10),
  code varchar(10),
  seq integer
  )
  

    insert into Veggies
    values 
    (1,'happy','1-veggies','GHF',1),
    (1,'sad','1-veggies','HGF',2),
    (2, 'angry' ,'1-veggies'    ,'GHG',3),
    (2, 'sad',  '1-veggies',    'FGH',4),
    (3, 'sad',  '1-veggies',    'HGF',5),
    (4, 'moody',    '2-meat',   'FFF',6),
    (4, 'sad',  '2-meat',   'HGF',7),
    (5, 'excited',  '2-meat',   'HGF',8)
    
    with t1 (num,seq)
    as
    (
    select num,seq
    
    from veggies
      
      where emotion='sad' and food='1-veggies'
      ),
      
    t2 (num,seq)
    as
    (
    select num,seq
    
    from veggies
      
    where code='GHF' or code='FGH'
      )
      
      select *
      
      from t1 inner join t2 on t1.num=t2.num and t1.seq<>t2.seq
相关问题