Comments (3)
通过这种生成图像的方式,如果是按照实践中提供的代码进行训练的话,因为是在程序执行时才划分了训练集、验证集和测试集,很可能会导致部分图片及其通过图像增强得到的图片同时出现在训练集、验证集和测试集中,实际上对模型的精度测量会产生了干扰。
除此之外,在训练中如果是将所有图片加载到内存中再进行训练,对内存也是一个很大的考验,很可能导致内存被消耗尽,建议采用model.fit_generator方法进行模型的训练。该方法通过指定图像增强的生成器,在训练的时候,每次从训练集和测试集中随机选取指定数量的图像进行增强后,送入模型进行训练,减少了对内存的占用。
图像增强的生成器需要事先把指定文件夹中的图像再按照分类分为不同的文件夹存放,比如在训练文件夹中再创建dog和cat文件夹来分别存放猫、狗图片。这样的话,生成器可以根据文件夹的不同来区分出生成的图像是属于哪个类别的。
具体的实现步骤,可以参考我的这篇文章:第二期扩展实践:提升模型精度的几种尝试中的第四步。
当然,这种方式的训练时间也是非常慢,同时我的这个实践没有取得很好的效果,最终还是放弃了。再这里提出来,希望对你能够有所帮助,也希望你的实践能取得好的效果!
from modelarts-lab.
@leewishyuanfang 嘿嘿 谢谢李哥的指点,嗯。我这办法确实问题很大。我已经在研究你的第四步了。下次你早点发,我就少走弯路了!!!哈哈哈哈
from modelarts-lab.
牛逼
from modelarts-lab.
Related Issues (20)
- 加载OBS里的数据总是找不到文件? HOT 1
- 模型如何导出?
- 识别滑动验证码模式异常
- 部署时customize_service.py文件怎么安装第三方库
- 训练任务执行失败
- notebook上提示Please reissue the pip command in a separate terminal or command prompt.终端是在哪里呢?
- 请问训练作业-常用框架的num_gpus参数如何解析
- 第二天登录发现前一天的ModelArts里的自动学习,数据集,模型等都没了。。 HOT 1
- Dockerfile
- 找不到数据是什么意思,明明能查看到,但是在创建modelArts就找不到
- 无法导入moxing module
- 打不开ipynb HOT 1
- Some images is gone! HOT 1
- 缺少用于“导入模型”的自定义镜像demo
- saved_model.pb错写成svaed_model.pb
- Dockerfile base image
- 离线 难例挖掘
- Some images not found because the file suffix is inconsistent
- 如果我用NES模拟器,玩超级马里奥,那么如何配置环境呢
- 华为云并行系统中的数据如何读取并存储为.csv格式?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelarts-lab.