【分布式Tensorflow(0.11.0)问题 未解决】Segmentation fault (core dumped)

本文主要是介绍【分布式Tensorflow(0.11.0)问题 未解决】Segmentation fault (core dumped),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

有三个测试,主函数是基本一样的,就是模型不同,但是均以 Segmentation fault (core dumped) 出错。


在我上一篇问题记录里,是以dummy数据集测试的,只有前向计算,没有参数更新和优化等操作,因此重新写了一个脚本,使用真实的数据集。


train数据集:

960831张图片(224*224),已转换为97个tfrecords文件,如下所示:

[root@dl1 train]# ls
train_224_0.tfrecords   train_224_32.tfrecords  train_224_55.tfrecords  train_224_78.tfrecords
train_224_10.tfrecords  train_224_33.tfrecords  train_224_56.tfrecords  train_224_79.tfrecords
train_224_11.tfrecords  train_224_34.tfrecords  train_224_57.tfrecords  train_224_7.tfrecords
train_224_12.tfrecords  train_224_35.tfrecords  train_224_58.tfrecords  train_224_80.tfrecords
train_224_13.tfrecords  train_224_36.tfrecords  train_224_59.tfrecords  train_224_81.tfrecords
train_224_14.tfrecords  train_224_37.tfrecords  train_224_5.tfrecords   train_224_82.tfrecords
train_224_15.tfrecords  train_224_38.tfrecords  train_224_60.tfrecords  train_224_83.tfrecords
train_224_16.tfrecords  train_224_39.tfrecords  train_224_61.tfrecords  train_224_84.tfrecords
train_224_17.tfrecords  train_224_3.tfrecords   train_224_62.tfrecords  train_224_85.tfrecords
train_224_18.tfrecords  train_224_40.tfrecords  train_224_63.tfrecords  train_224_86.tfrecords
train_224_19.tfrecords  train_224_41.tfrecords  train_224_64.tfrecords  train_224_87.tfrecords
train_224_1.tfrecords   train_224_42.tfrecords  train_224_65.tfrecords  train_224_88.tfrecords
train_224_20.tfrecords  train_224_43.tfrecords  train_224_66.tfrecords  train_224_89.tfrecords
train_224_21.tfrecords  train_224_44.tfrecords  train_224_67.tfrecords  train_224_8.tfrecords
train_224_22.tfrecords  train_224_45.tfrecords  train_224_68.tfrecords  train_224_90.tfrecords
train_224_23.tfrecords  train_224_46.tfrecords  train_224_69.tfrecords  train_224_91.tfrecords
train_224_24.tfrecords  train_224_47.tfrecords  train_224_6.tfrecords   train_224_92.tfrecords
train_224_25.tfrecords  train_224_48.tfrecords  train_224_70.tfrecords  train_224_93.tfrecords
train_224_26.tfrecords  train_224_49.tfrecords  train_224_71.tfrecords  train_224_94.tfrecords
train_224_27.tfrecords  train_224_4.tfrecords   train_224_72.tfrecords  train_224_95.tfrecords
train_224_28.tfrecords  train_224_50.tfrecords  train_224_73.tfrecords  train_224_96.tfrecords
train_224_29.tfrecords  train_224_51.tfrecords  train_224_74.tfrecords  train_224_9.tfrecords
train_224_2.tfrecords   train_224_52.tfrecords  train_224_75.tfrecords  train_224_image_mean.npy
train_224_30.tfrecords  train_224_53.tfrecords  train_224_76.tfrecords
train_224_31.tfrecords  train_224_54.tfrecords  train_224_77.tfrecords


Main函数:
def main(_):ps_hosts = FLAGS.ps_hosts.split(",")worker_hosts = FLAGS.worker_hosts.split(",")cluster = tf.train.ClusterSpec({"ps": ps_hosts, "worker": worker_hosts})server =   tf.train.Server(cluster,job_name=FLAGS.job_name,task_index=FLAGS.task_index)issync = FLAGS.issyncif FLAGS.job_name == "ps":server.join()elif FLAGS.job_name == "worker":images, labels = ...with tf.device(tf.train.replica_device_setter(worker_device="/job:worker/task:%d" % FLAGS.task_index,cluster=cluster)):global_step = tf.Variable(0, name='global_step', trainable=False)# 修改这里,调用不同的模型logits, parameters = inference(images)logits = tf.contrib.layers.flatten(logits)cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=labels, logits=logits, name='xentropy')loss_value = tf.reduce_mean(cross_entropy, name='xentropy_mean')       optimizer = tf.train.GradientDescentOptimizer(learning_rate)       grads_and_vars = optimizer.compute_gradients(loss_value)if issync == 1:# Synchronous moderep_op = tf.train.SyncReplicasOptimizer(optimizer,replicas_to_aggregate=len(worker_hosts),replica_id=FLAGS.task_index,total_num_replicas=len(worker_hosts),use_locking=True)train_op = rep_op.apply_gradients(grads_and_vars, global_step=global_step)init_token_op = rep_op.get_init_tokens_op()chief_queue_runner = rep_op.get_chief_queue_runner()else:# Asynchronous modetrain_op = optimizer.apply_gradients(grads_and_vars, global_step=global_step)init_op = tf.initialize_all_variables()saver = tf.train.Saver()tf.summary.scalar('cost', loss_value)summary_op = tf.summary.merge_all()sv = tf.train.Supervisor(is_chief=(FLAGS.task_index == 0),logdir="./alexnet_checkpoint",init_op=init_op,summary_op=None,saver=saver,global_step=global_step,save_model_secs=60)with sv.prepare_or_wait_for_session(server.target) as sess:# Syncif FLAGS.task_index == 0 and issync == 1:sv.start_queue_runners(sess, [chief_queue_runner])sess.run(init_token_op)step = 0while not sv.should_stop():try:start_time = time.time()     _, loss_v, step = sess.run([train_op, loss_value, global_step])if step > 1000:breakduration = time.time() - start_timeif step >= 10:if not step % 10:             print ('%s: step %d, duration = %.3f' % (da

这篇关于【分布式Tensorflow(0.11.0)问题 未解决】Segmentation fault (core dumped)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/791317

相关文章

线上Java OOM问题定位与解决方案超详细解析

《线上JavaOOM问题定位与解决方案超详细解析》OOM是JVM抛出的错误,表示内存分配失败,:本文主要介绍线上JavaOOM问题定位与解决方案的相关资料,文中通过代码介绍的非常详细,需要的朋... 目录一、OOM问题核心认知1.1 OOM定义与技术定位1.2 OOM常见类型及技术特征二、OOM问题定位工具

C++右移运算符的一个小坑及解决

《C++右移运算符的一个小坑及解决》文章指出右移运算符处理负数时左侧补1导致死循环,与除法行为不同,强调需注意补码机制以正确统计二进制1的个数... 目录我遇到了这么一个www.chinasem.cn函数由此可以看到也很好理解总结我遇到了这么一个函数template<typename T>unsigned

Vue3绑定props默认值问题

《Vue3绑定props默认值问题》使用Vue3的defineProps配合TypeScript的interface定义props类型,并通过withDefaults设置默认值,使组件能安全访问传入的... 目录前言步骤步骤1:使用 defineProps 定义 Props步骤2:设置默认值总结前言使用T

504 Gateway Timeout网关超时的根源及完美解决方法

《504GatewayTimeout网关超时的根源及完美解决方法》在日常开发和运维过程中,504GatewayTimeout错误是常见的网络问题之一,尤其是在使用反向代理(如Nginx)或... 目录引言为什么会出现 504 错误?1. 探索 504 Gateway Timeout 错误的根源 1.1 后端

Web服务器-Nginx-高并发问题

《Web服务器-Nginx-高并发问题》Nginx通过事件驱动、I/O多路复用和异步非阻塞技术高效处理高并发,结合动静分离和限流策略,提升性能与稳定性... 目录前言一、架构1. 原生多进程架构2. 事件驱动模型3. IO多路复用4. 异步非阻塞 I/O5. Nginx高并发配置实战二、动静分离1. 职责2

解决升级JDK报错:module java.base does not“opens java.lang.reflect“to unnamed module问题

《解决升级JDK报错:modulejava.basedoesnot“opensjava.lang.reflect“tounnamedmodule问题》SpringBoot启动错误源于Jav... 目录问题描述原因分析解决方案总结问题描述启动sprintboot时报以下错误原因分析编程异js常是由Ja

深度剖析SpringBoot日志性能提升的原因与解决

《深度剖析SpringBoot日志性能提升的原因与解决》日志记录本该是辅助工具,却为何成了性能瓶颈,SpringBoot如何用代码彻底破解日志导致的高延迟问题,感兴趣的小伙伴可以跟随小编一起学习一下... 目录前言第一章:日志性能陷阱的底层原理1.1 日志级别的“双刃剑”效应1.2 同步日志的“吞吐量杀手”

MySQL 表空却 ibd 文件过大的问题及解决方法

《MySQL表空却ibd文件过大的问题及解决方法》本文给大家介绍MySQL表空却ibd文件过大的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考... 目录一、问题背景:表空却 “吃满” 磁盘的怪事二、问题复现:一步步编程还原异常场景1. 准备测试源表与数据

Redis实现分布式锁全过程

《Redis实现分布式锁全过程》文章介绍Redis实现分布式锁的方法,包括使用SETNX和EXPIRE命令确保互斥性与防死锁,Redisson客户端提供的便捷接口,以及Redlock算法通过多节点共识... 目录Redis实现分布式锁1. 分布式锁的基本原理2. 使用 Redis 实现分布式锁2.1 获取锁

解决Nginx启动报错Job for nginx.service failed because the control process exited with error code问题

《解决Nginx启动报错Jobfornginx.servicefailedbecausethecontrolprocessexitedwitherrorcode问题》Nginx启... 目录一、报错如下二、解决原因三、解决方式总结一、报错如下Job for nginx.service failed bec