ubuntu 下快速增加 swap 文件

df -h

This will show your file system and how much space you have left.

– sudo fallocate -l 8G /swapfile

Create a 8 GB of swap

sudo chmod 600 /swapfile

Change file permissions

– sudo mkswap /swapfile

sudo swapon /swapfile

– free -m

This will show you the swap file is on. You can also pull up the System Monitor

However this is only temporary. If you reboot, swap file is gone.

-$ sudo nano /etc/fstab

Within this file add the line “/swapfile none swap defaults 0 0”. Do not include the quotes.

Exit and save file

Now you can reboot and your Swap will be activated.

Then you can successfully train the CIFAR-10 dataset.

Ideally you would want to create a swap partition on an attached SSD or M.2 SSD and not use any of the internal memory.

打赏
Bookmark the permalink.
0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论