机器学习中大量的用到了Python,因此需要有pycharm作为Python的编译工具,配合anconda环境进行配置,将macos,tensorflow ,python的配置记录下:
We suggest using Anaconda python 2.7 distribution: ```sh >>wget https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh (depending on your OS, choose the appropriate URL from https://www.continuum.io/downloads) >>bash Anaconda2-4.2.0-Linux-x86_64.sh >>conda config --append channels conda-forge ``` Create a virtual environment: ```sh >>conda create -n frontier27 python=2.7 //创立了一个Python2.7环境frontier27 >>source activate frontier27 //激活这个环境 ``` //然后再这个环境下安装tensorflow代码依赖的各种东西 Install dependent packages (menpo project, tensorflow, keras, scikit-image, h5py, bidict) in this virtual environment: ```sh >>conda install -c menpo menpoproject >>pip install --upgrade tensorflow (use tensorflow-gpu if you want GPU support) >>pip install -Iv keras==1.2.2 (make sure you install version 1.2.2) >>conda install scikit-image h5py bidict psutil imageio ``` //关闭环境是source deacitive frontier27
ok,配置完tensorflow anconada的环境,然后打开pycharm。然后配置pycharm-preference,将环境改到我们配置好的路径下,这里我起的名字不是
frontier27,而是face27因此:
因此搞定了配置,接下来需要讲解下关于在pycharm里面设置里面参数的外部路径,
比如vid_path保存了测试video的路径,一旦在代码外部进行了设置,即使代码里面有修改,也会跟外部保持一致
时间: 2024-10-09 14:42:35