Giter VIP home page Giter VIP logo

flowerclassification's Introduction

FlowerClassification

a little task when learning Pytorch

the environment is very brief:

conda create -n flowerclassification python=3.8.0
conda activate flowerclassification
pip install torch

some other packages according to the "flower_division.ipynb"

this project runs on MacbookPro with M2, so I use the "mps" instead of "cuda"

需要注意的只有一个位置

在“10 准备训练模块”这个部分中,下面有两个cell,但是这两个cell做的是同一个事,都是实现训练函数。

第一个cell只有一个函数,就是train_model,这个是把train和test两个数据集部分通过for循环便利两次,然后在这个函数中通过if语句分开这两个部分

第二个cell有三个函数,train_epoch、test_epoch、train_model_divide,这个是分开写的写法,我觉得更清楚一点。就是把train_data和test_data要做的事分开了。

然后相应的,在“11 开始炼丹”这个部分中,就有这两个函数的分开调用,第一个注释掉的调用对应的是上面所说的第一个cell,第二个调用对应的就是第二个cell

关于代码中第二次训练那个标红的

不用管,那个是手动中断训练了的,没啥问题

关于数据集

download from this: 链接: https://pan.baidu.com/s/1twMPUXuek1W4gzaZiS19Jw?pwd=yq23 提取码: yq23 --来自百度网盘超级会员v1的分享

初学Pytorch,可能还有错误的地方,继续努力...

flowerclassification's People

Contributors

shawnricardo avatar

Stargazers

Yibo Yin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.