0%

  1. tensorboard的使用

    1. SummaryWriter(“logs”):用于读取logdir中的日志
    2. add_scalor():用于图像绘制
    3. add_image():用于获取图像到summary中
      1. 通常dataformats=’CHW’,但是ndarray格式要修改为dataformats=’HWC’
  2. transforms的使用

    1. 为什么用tensor

      tensor就是矩阵,就是神经网络专用的数据类型,包含了许多神经网络需要的参数。

    2. PIL和np.array(opencv)的区别:cv2是BGR PIL是RGB

    3. Ctrl+P的功能:查看填入上面类型的参数

    4. ToTensor():转换图像类型格式

      ​ Convert a PIL Image or numpy.ndarray to tensor

    5. Normalize():用平均值和标准差对张量图像进行归一化

      input[channel] = (input[channel] - mean[channel]) / std[channel]

    6. Resize():把PIL image调整为特定的尺寸

    7. Compose():

      ​ Compose()中的参数需要是一个列表,在Python中,列表的表示形式为[数据1,数据2,…],而在Compose中,数据需要是transforms类型,所以得到,Compose([transforms参数1, transforms参数…])

      ​ 相当于把PIL图像resize后,转化为tensor类型两个步骤组合起来。

  3. 要点

    1. 关注输入和输出类型

    2. 多看pytorch官方文档

    3. 关注方法需要什么参数(Ctrl+P)

    4. 不知道返回值的时候

      ​ print()

      ​ print(type())

      ​ (断点)debug

  4. torchvision中数据集的使用

    1. pytorch官网检索数据集、分割模型等
    2. 下载公共数据集到dataset文件夹位置
  5. dataloader的使用

    1. dataset作用:指定数据集的位置,列表中的位置(例如[0])指的是那个数据
    2. dataloader原理:数据加载器,将数据加载到神经网络中

dataloader

​ 3. 各项参数的使用,以及在tensorboard上的图片可视化

1
test_loader = DataLoader(test_data,batch_size=64,shuffle=True,num_workers=0,drop_last=True)
  1. 神经网络的搭建:神经网络的基本骨架(nn.module的使用)

一、博客安装笔记(部署在Github)
  1. #安装Node.js,直接去官网下载最新版:nodejs.org
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
node -v	#查看node版本

npm -v #查看npm版本

npm install -g cnpm --registry=http://registry.npm.taobao.org #安装淘宝的cnpm 管理器

cnpm -v #查看cnpm版本

cnpm install -g hexo-cli #安装hexo框架

hexo -v #查看hexo版本

mkdir blog #创建blog目录

cd blog #进入blog目录

hexo init #生成博客 初始化博客

hexo init如果报错

1
2
3
error: RPC failed; curl 28 Recv failure: Connection was reset

fatal: expected flush after ref listing

先输入:

1
git config --global http.sslVerify "false"
1
hexo s	#启动本地博客服务

http://localhost:4000/ #本地访问地址

1
2
3
4
5
6
7
8
9
10
11
hexo n "我的第一篇文章" #创建新的文章 

#返回blog目录

hexo clean #清理

hexo g #生成

#Github创建一个新的仓库 YourGithubName.github.io

cnpm install --save hexo-deployer-git #在blog目录下安装git部署插件

  1. #配置_config.yml
1
2
3
4
5
6
7
8
9
10
11
# Deployment

## Docs: https://hexo.io/docs/deployment.html

deploy:

type: 'git'

repo: https://github.com/Jenny-ju/Jenny-ju.github.io.git

branch: master

  1. #重新清理、生成、部署到仓库
1
2
3
4
5
hexo clean  # 这个一定要有,否则会404,打不开网页

hexo g #生成

hexo d #部署到Github仓库里

  1. #访问这个地址可以查看博客

https://jenny-ju.github.io/ #查看博客


  1. #更改主题
1
2
3
4
5
6
7
8
9
 git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia  #下载yilia主题到本地

\#修改hexo根目录下的 _config.yml 文件 : theme: yilia

hexo clean #清理一下(注意:windows下不能缩写)

hexo g #生成

hexo d #部署到远程Github仓库

https://jenny-ju.github.io/ #查看博客


  1. 报错:Spawn failed
1
2
3
4
5
6
7
8
9
# 报错内容:
Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (E:\Projects\blog\node_modules\.store\hexo-util@2.7.0\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:514:28)
at cp.emit (E:\Projects\blog\node_modules\.store\cross-spawn@7.0.3\node_modules\cross-spawn\lib\enoent.js:34:29)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
1
2
3
4
# 报错原因:代码提交到GitHub上出错,需要输入GitHub账户默认标识
# 解决方法:输入以下两行代码
git config --global user.email "21981682202@qq.com"
git config --global user.name "Jenny-ju"

  1. hexo无法显示图片的问题,按照下面方法还是未解决

hexo无法显示本地图片的问题_hexo 图片无法加载-CSDN博客

二、博客安装笔记(部署在Gitee)
  1. 配置SSH免密登录

Hexo博客搭建和使用教程(Windows)_hexo安装-CSDN博客

  1. 解决Gitee网站404问题:要开启GiteePages功能

hexo+gitee(码云)搭建个人博客避开所有坑-CSDN博客

  1. 其他步骤和Github一样
三、样式修改next

Hexo-Next 主题博客个性化配置超详细,超全面(两万字)_hexo next 记录访问了ip-CSDN博客

Hexo 添加分类及标签-CSDN博客

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment