首页 > 解决方案 > 由于 IPython 和 Windows 的限制,python 多处理现在不可用。所以将`number_workers`改为0以避免卡住

问题描述

在此处输入图像描述

#id first_training
#caption Results from the first training
# CLICK ME
from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'

def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
    path, get_image_files(path), valid_pct=0.2, seed=42,
    label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)

由于 IPython 和 Windows 的限制,python 多处理现在不可用。所以number_workers改为0避免卡住

嗨,我正在学习 Fastai 书,我在没有 colab 或图纸空间的情况下运行此代码。

但出乎我的意料,这需要很长时间(我的电脑是工作站)

但我想知道我是否清除了那个错误

也许增加'number_workers',它会比以前快得多。

如何解决这个问题呢?

谢谢

标签: multiprocessing

解决方案


推荐阅读