当前位置:网站首页>AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
2022-06-26 15:36:00 【there2belief】
使用tf.distribute.MirroredStrategy()時,出現警告:
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy because of the following reason: Did not find a shardable source, walked to a node which is not a dataset
代碼如下:
strategy = tf.distribute.MirroredStrategy()
with strategy.scope():
keras_model = build_model()
train_datagen = ImageDataGenerator()
training_img_generator = train_datagen.flow_from_directory(
input_path,
target_size=(image_size, image_size),
batch_size=batch_size,
class_mode="categorical",
)
train_dataset = tf.data.Dataset.from_generator(
lambda: training_img_generator,
output_types=(tf.float32, tf.float32),
output_shapes=([None, image_size, image_size, 3], [None, len(image_classes)])
)
# similar for validation_dataset = ...
keras_model.fit(
train_dataset,
steps_per_epoch=train_steps_per_epoch,
epochs=epoch_count,
validation_data=validation_dataset,
validation_steps=validation_steps_per_epoch,
)Now this seem to work, the model is trained as usual. However, during training I get the following warning message, when using a mirrored strategy:
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy because of the following reason: Did not find a shardable source, walked to a node which is not a dataset
嘗試解决但無效
So I added the following lines between creating the data sets and calling fit():
options = tf.data.Options()
options.experimental_distribute.auto_shard_policy = tf.data.experimental.AutoShardPolicy.DATA
train_dataset.with_options(options)
validation_dataset.with_options(options)However, I still get the same warning.
This leads me to these two questions:
- What do I need to do in order to get rid of this warning?
- Even more important: Why is TF not able to split the dataset with the default
AutoShardPolicy.FILEpolicy, since I am using thousands of images per class in the input folder?
边栏推荐
猜你喜欢
随机推荐
查词翻译类应用使用数据接口api总结
【TcaplusDB知识库】TcaplusDB常规单据介绍
Unity C # e-learning (10) -- unitywebrequest (2)
# 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
Sorted out a batch of script standard function modules (version 2021)
Using restcloud ETL shell component to schedule dataX offline tasks
Secure JSON protocol
Applicable and inapplicable scenarios of mongodb series
CNN优化trick
【ceph】CephFS 内部实现(四):MDS是如何启动的?--未消化
评价——模糊综合评价
【文件】VFS四大struct:file、dentry、inode、super_block 是什么?区别?关系?--编辑中
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
Beijing Fangshan District specialized special new small giant enterprise recognition conditions, with a subsidy of 500000 yuan
Mongodb series window environment deployment configuration
【TcaplusDB知识库】TcaplusDB系统管理介绍
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
How to load the contour CAD drawing of the engineering coordinate system obtained by the designer into the new earth
2022 Beijing Shijingshan District specializes in the application process for special new small and medium-sized enterprises, with a subsidy of 100000-200000 yuan
sqlite加载csv文件,并做数据分析









