Deleting a branch is permanent. It CANNOT be undone. Continue?
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》
问题所属任务编号(Task 01-05)
task03 softmax回归从零开始实现
运行环境(操作系统版本、Python 版本)/ 非程序问题
python3.9
完整的报错信息(截图或复制均可)/ 问题详细描述
E:\miniconda3\envs\d2l\lib\site-packages\torch\utils\data\dataloader.py:561: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2 (
cpuset
is not taken into account), which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.warnings.warn(_create_warning_msg(
描述你期望看到的结果
你没有说明操作系统版本,但是我预估你是 Windows 10/11,你可以试试将
num_workers
设置为 0,这是 Windows 下的一个 bug操作系统是windows10,
import torch
from IPython import display
from d2l import torch as d2l
batch_size = 256
train_iter,test_iter = d2l.load_data_fashion_mnist(batch_size)
train_iter,test_iter = d2l.load_data_fashion_mnist(batch_size) 我试过将num_workers 设置为 2,但这条指令里没有num_workers这个参数
oh no,它在
d2l
中是写死的数字,你需要在d2l/torch.py
中找到get_dataloader_workers
这个函数,然后将return 4
改为return 0
,或者你也可以直接修改load_data_fashion_mnist
的num_workers
为 0,这会涉及到对d2l
包源代码的修改,我建议你在 IDE 或者代码编辑器中完成谢谢