Closed vseasky closed 4 years ago
OOM是显存不足的问题. 第二个问题可能是启动了eager execution,或者应该修改导入用如下标准方式:
import tensorflow as tf
import tensorflow.keras as keras
之前开发时由于vscode
的自动补全功能不够完善,所以我没有使用标准导入方式. 这可能引起了不同平台的偏差行为.
train_model.fit(h.train_dataset,
epochs=max_nrof_epochs,
steps_per_epoch=h.train_epoch_step,
callbacks=cbs,
validation_data=h.test_dataset,
validation_steps=int(h.test_epoch_step * h.validation_split))#此处报错
main(args, args.train_set, args.class_num, args.pre_ckpt,
args.model_def, args.depth_multiplier, args.augmenter,
args.image_size, args.output_size, args.batch_size, args.rand_seed, args.max_nrof_epochs,
args.init_learning_rate, args.learning_rate_decay_factor,
args.obj_weight, args.noobj_weight, args.wh_weight, args.obj_thresh, args.iou_thresh, args.vaildation_split,
args.log_dir,
args.is_prune,
args.prune_initial_sparsity,
args.prune_final_sparsity,
args.prune_end_epoch,
args.prune_frequency)#此处报错
你用的是不是tensorflow-1.15
,如果是1.15参考我的博客.如果是1.14也尝试使用这个方法试试看.如果不行的话建议用Ubuntu
.
可以了,不过最后下载到K210效果很差,不太清楚什么原因
ga该模型不支持IMGSIZE 240*320?
效果需要自己针对模型进行调优,此仓库仅作为一个基础的pipeline参考。240不是32的倍数,会导致上采样融合层的维度不匹配,可以删除那个上采样层融合层,或者修改上采样的倍数为浮点数。不过我记得我尝试过修改上采样倍数为浮点数会导致无法转换为tflite。
您好,我是 win10 的系统,按照 requirements 安装的环境。运行 keras_train.py 文件时,报 No module named 'tensorflow.python.types ' ,看了下这个功能是 from tensorflow.contrib.data import assert_element_shape 时报出的,有没有解决方案?谢谢~
确定是tf1.14吗?或者你可以试试直接导入tensorflow as tf,然后用tf.contrib.data.xxx来调用对应的函数,看看能否解决。
确定是1.14。您用的是tensorflow还是tensorflow-gpu?这两个版本是不是也会有影响?
是tensorflow-gpu
。在命令行中执行对assert_element_shape
的导入还会出错吗?
会的,和之前执行训练命令报的错误一样。
问题的原因找到并解决了,应该是tensorflow_estimator导致的。tensorflow_estimator的版本能查看么?我可以在确认一下。
我刚刚想在windows下面装一下tf帮你看看。结果我装tf就报错cuda版本问题-_-。tensorflow_estimator
你可以用conda list
或者pip list
查看,一般情况下是和tensorflow
本体的版本一致的。
用conda list或pip list查看,tensorflow_estimator的版本是1.14的,但我从另一个环境拷贝过来另一个1.14的tensorflow_estimator和现有的文件不同。不知道是之前哪一步出了问题(之前因为版本问题装卸了很多次)。。。