[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
我所用的笔记本电脑没有独立显卡,因此也不支持cuda等软件的安装
1.batch_size
今天用cpu跑深度学习的时候,原本代码的batch_size=512,我知道我的电脑肯定跑不了这么大的batch_size,就设置成batch_size=256,但是jupyter
notebook在跑第一个epoch的时候还是显示我的内核挂掉了,重启两三次都仍会遇到这个问题。
解决办法:把batch_size大小设置为100,在我的电脑上就可以正常运行了
每台电脑的cpu也不同,遇到类似的内核挂掉的问题,可以试着减少batch_size的大小
2.epoch
可以简单地理解为迭代的次数,与batch_size一样也会影响深度学习的速度
当epoch=50 batch_size=100的时候运行到第32个epoch还是显示内核挂掉了,我不太清楚是这两个哪个的问题,或者可能是数据量的问题。
但是我试验过,当epoch=30 batch_size=100的时候,是可以运行的。
3.运行速度
cpu处理深度学习的速度要比gpu慢很多,具体可以看下面的数据对比:
us/stepbatch_sizeepoch
GPU449us/step512200
CPU480ms/step10050
很明显,两者的差异非常大,所以还是建议有GPU的一定要在GPU上跑,训练的数据量可以更大一些,得到的准度也会更高一些,实在不行的话再在CPU上跑。
4.continue