安装的一些问题

keras安装过程的总结

  • 下载安装anaconda

  • D盘建立环境:我的虚拟环境:py3.7(3.7.11)

    • conda create -n name
  • jupter notebook:安装与使用

    远程访问配置

    • jupyter notebook --generate-config
      
    • 执行成功后:会出现

      Writing default config to: /root/.jupyter/jupyter_notebook_config.py
      
    • 生成密码:jupyter notebook password,生成的密码存储在 jupyter_notebook_config.json

    • 修改配置文件:找到当前用户:~\\.jupyter\jupyter_notebook_config.py
      修改对应内容:

      • c.NotebookApp.ip = '192.168.43.31'
      • c.NotebookApp.open_browser = False
      • c.NotebookApp.password = u'sha1:2c0a4092ad6d:174e7c4544aba4d4c5366a9466a7ea3232935b42'对应json文件中的,实际上是123456
      • c.NotebookApp.port = 8888
    • 在浏览器输入ip:端口即可访问(密码为生成密码时输入的)

      此次设计好之后,下次命令行输入jupyter notebook,连接的网络不一样,ip不一样,会报错

      输入jupyter notebook --generate-config会重置设置

  • 安装需要的包

问题解决经验总结:

  • jupyter notebook kernel error

    • pywin32卸载安装对应版本:3.7》227
  • tensorflow与keras与python版本要对应

    • 2.2.0》2.3.1》3.7
  • 国内镜像源pip安装 -i

    (1)阿里云 http://mirrors.aliyun.com/pypi/simple/
    (2)豆瓣http://pypi.douban.com/simple/
    (3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
    (4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
    (5)华中科技大学http://pypi.hustunique.com/

  • 在虚拟环境中conda install nb_conda后可以在虚拟环境中jupyter notebook从而使用虚拟环境的python

如果你安装的是 tensorflow 2.x 你可以在导入 tensorflow 时使用 import
tensorflow.compat.v1 as tf # 导入 1.x 版本的 tensorflow import numpy as np

tf.disable_v2_behavior() # 停止使用 2.x 版本的 tensorflow 行为

强制使用 1.x 版本的 tensorflow

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值