在Anaconda中配置多个环境

试想一下假如你之前的很多深度学习模型都是使用基于keras 1.x写的。现在你写了一个基于Keras 2.x的模型,或者你找到的一个别人公开的代码是基于Keras 2.x的。那么如何既能运行原先写的基于Keras 1.x的程序,又可以运行现在这些Keras 2.x的程序呢? Anaconda为我们提供了一个很方便的方法:配置多个环境,一个环境是Keras 1.x的,另一个环境是Keras 2.x。

步骤为:

1.新建anaconda环境,名为new_keras

conda create -n new_keras

2.切换到new_keras这个环境

source activate new_keras

(windows下为activate new_keras)

3.选择python版本(可选)

由于python版本不对应,切换到相应的版本

conda install python=3.5

4.安装tensorflow

到https://github.com/tensorflow/tensorflow下载.whl文件

pip install --ignore-installed --upgrade 文件路径

5.安装最新版本keras

pip install keras

使用时,通过source activate new_keras切换到该环境,这时可以通过conda install安装库,通过python命令运行程序。

另外,使用conda info –envs可以看到conda里面的环境。通过conda activate root可以切换回默认环境。

在pyCharm中使用anacondas 环境, 可以通过:

File->Settings->Project->Project Interpreter

选择相应的环境。一般来说,选择Anaconda安装目录下的envs/new_keras/python.exe。

参考:

https://conda.io/docs/using/envs.html

160 评论

  1. Pingback: Nike Outlet Store
  2. Pingback: NFL Jerseys
  3. Pingback: Yeezy
  4. Pingback: Nike Outlet
  5. Pingback: Nike Outlet
  6. Pingback: Travis Scott jordan 1
  7. Pingback: Yeezy Boost 350 V2
  8. Pingback: Yeezy
  9. Pingback: Yeezy
  10. Pingback: Yeezy
  11. Pingback: air jordan 11 concord
  12. Pingback: lyngby bk vs agf
  13. Pingback: gumiaki z kokardk膮
  14. Pingback: trustedmdstorefy.com
  15. Pingback: bofilm ???èà?
  16. Pingback: bofilm
  17. Pingback: 1 seriya
  18. Pingback: topedstoreusa.com
  19. Pingback: viagramdtrustser.com
  20. Pingback: mens ua camo 2.0 cap
  21. Pingback: 4serial.com
  22. Pingback: See-Season-1
  23. Pingback: Evil-Season-1
  24. Pingback: Evil-Season-2
  25. Pingback: Evil-Season-3
  26. Pingback: Evil-Season-4
  27. Pingback: Dollface-Season-1
  28. Pingback: serviette plage femme
  29. Pingback: Human Races
  30. Pingback: Cheap MLB Jerseys
  31. Pingback: serial 2020
  32. Pingback: Dailymotion
  33. Pingback: Watch+movies+2020
  34. Pingback: Human Race Shoes
  35. Pingback: Yeezy Boost 380
  36. Pingback: serial
  37. Pingback: tvrv.ru
  38. Pingback: 1plus1tv
  39. Pingback: #1plus1
  40. Pingback: 1plus1
  41. Pingback: 2020
  42. Pingback: Uggs Official Site
  43. Pingback: Nike Factory Outlet
  44. Pingback: Watch Movies Online
  45. Pingback: Film
  46. Pingback: Film 2020
  47. Pingback: Film 2021
  48. Pingback: Top 10 Best
  49. Pingback: watch online TV LIVE
  50. Pingback: vionic fitflops
  51. Pingback: Yeezy 380
  52. Pingback: Nike Outlet Online
  53. Pingback: osnovci blic online
  54. Pingback: nike huarache girls
  55. Pingback: puma ess logo beanie
  56. Pingback: barna gy枚ngy szett

发表评论