Pytorch创建数据集基础

Posted by LemonWhale on April 23, 2023

dir(pytorch) 打开pytorch分割区

help(pytorch.3.a) 说明书

pytorch读取数据

Dataset: 提供一种方式去获取数据及其label

\[\text { 数据集 }\left\{\begin{array}{l} \text { train } \left\{\begin{array}{ll} \text { cat } & \text { image } \\ \text { dog } & \text { image } \end{array}\right. \\ \\ \text { test } \left\{\begin{array}{ll} \text { cat } & \text { image } \\ \text { dog } & \text { image } \end{array}\right. \end{array}\right. \qquad \text { 数据集 }\left\{\begin{array}{l} \text { train }(\text { image }) \\ \text { label }(\text{txt})\\ \\ \text { test}(\text { image })\\ \text { label }( \text{txt}) \end{array}\right.\]


此外还可以直接将label写成图片名