当前位置:网站首页>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:22: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?
边栏推荐
- 5张图诠释了容器网络
- 使用RestCloud ETL Shell组件实现定时调度DataX离线任务
- JS events
- [CEPH] Introduction to cephfs caps
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
- 【SNMP】snmp trap 介绍、安装、命令|Trap的发送与接收代码实现
- 如何配置使用新的单线激光雷达
- Compile configuration in file
- Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
- Using restcloud ETL shell component to schedule dataX offline tasks
猜你喜欢

【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍

Unable to download Plug-in after idea local agent

一篇博客彻底掌握:粒子滤波 particle filter (PF) 的理论及实践(matlab版)
MySQL数据库基本SQL语句教程之高级操作

音视频学习(三)——sip协议
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction](/img/7c/25a88f46e02cebd2e003b9590b9c13.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction

小程序:uniapp解决 vendor.js 体积过大的问题
![[CEPH] cephfs internal implementation (II): example -- undigested](/img/87/6eb214550faf1f0500565c1610ff3b.png)
[CEPH] cephfs internal implementation (II): example -- undigested

English grammar_ Adjective / adverb Level 3 - original sentence pattern

sqlite加载csv文件,并做数据分析
随机推荐
Advanced operation of MySQL database basic SQL statement tutorial
【TcaplusDB知识库】TcaplusDB数据构造介绍
Function: crypto JS encryption and decryption
【TcaplusDB知识库】TcaplusDB系统用户组介绍
【ceph】CephFS 内部实现(二):示例--未消化
[wechat applet] event binding, do you understand?
面试高频 | 你追我赶的Flink双流join
编译配置in文件
小程序:uniapp解决 vendor.js 体积过大的问题
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
/etc/profile、/etc/bashrc、~/.bashrc的区别
评价——模糊综合评价
JS之手写 bind、apply、call
功能:crypto-js加密解密
【ceph】cephfs的锁 笔记
HW安全响应
sqlite加载csv文件,并做数据分析
评价——TOPSIS
Secure JSON protocol
JS simple deepcopy (Introduction recursion)