返回文章

文章 2018

Python

Python 学习记录

PythonNotebookCommand
本文目录4
  1. install common packages
  2. create vertual envirnment
  3. using anaconda
  4. Tensorflow

install common packages

text
pip install jupyter -i https://mirrors.aliyun.com/pypi/simple
pip install tensorflow==1.15 -i https://mirrors.aliyun.com/pypi/simple/
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.11.0-py3-none-any.whl

create vertual envirnment

text
virtualenv --version
pip3 install -U virtualenv
virtualenv --no-site-packages venv
source venv/bin/activate
deactivate

using anaconda

text
# 取消默认激活 base 环境
conda config --set auto_activate_base false

# 查看系统中的所有环境
conda info -e

conda --version
conda upgrade --all
# 3.6 tensorflow 支持比较好
conda create -n learn python=3.6
conda activate learn
conda deactivate
conda remove -n learn --all

# install common used libraries
python3 -m pip install --upgrade pip
conda install -f matplotlib
conda install tensorflow
conda install numpy scipy pandas
conda install scikit-learn

Tensorflow

text
# 使用2.0中的v1兼容包来沿用1.x代码
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

# 不过不能解决 tf.contrib 不存在的问题
tf.contrib.layers.xavier_initializer
返回首页
上一篇Git下一篇PM2

Discussion

留言与讨论

想法、补充和不同意见都欢迎。