zoukankan      html  css  js  c++  java
  • 使用colab训练神经网络

    流程:上传数据集到自己的google drive => 新建google colaboratory => 把colab和drive连接起来以访问drive上的数据集、代码文件等。

    1.从google云盘新建colab的ipynb文件,重命名,并且修改为GPU。

    2.colab和drive的连接:

    from google.colab import drive
    drive.mount('/content/drive/')

    3.更改工作目录:

    1 import os
    2 path = "/content/drive/My Drive/Colab_Test/deep-image-prior/"
    3 os.chdir(path) 
    4 os.listdir(path)
    5 !ls

    4.从github上下载代码运行.py文件:

    !git clone https://github.com/migu***/s***

    5.运行程序

    # 运行该项目的main.py文件
    !python train.py

    对于我的程序需要修改的地方:

    1 !pip install tensorboardcolab
    2 from torch.utils.tensorboard import SummaryWriter
  • 相关阅读:
    用python将博客园的文章爬取到本地
    2016.7.9
    2016.7.8
    2016.7.7
    2016.7.5
    2016.7.4
    2016.7.3
    2016.7.2
    2016.6.28
    2016.6.27
  • 原文地址:https://www.cnblogs.com/zh-clara/p/15363876.html
Copyright © 2011-2022 走看看