问题描述:
Cifar10Dataset's num_workers=8, this value is not within the required range of [1, cpu_thr这个有办法解决吗?
解决方案:
试着设置为4或者3,2试试。
this value is not within the required range of [1, cpu_thread_cnt=4] 这应该是CPU只有4个线程,但是设置了8个,超过了实际硬件提供的,所以报错。
这里data_set = ds.Cifar10Dataset(dataset_path, num_parallel_workers=1, shuffle=True)
这里
data_set = data_set.map(operations=type_cast_op, input_columns="label", num_parallel_workers=1)
data_set = data_set.map(operations=trans, input_columns="image", num_parallel_workers=1)
需要ds.config.set_num_parallel_workers(4)指令设置并行工作器的默认数量