为了账号安全,请及时绑定邮箱和手机立即绑定

老师,在GPU里训练的模型,在CPU里运行的程序调用,出错,怎么解决呢?

老师,在GPU里训练的模型,在CPU里运行的程序调用,出错,怎么解决呢?

Traceback (most recent call last):

  File "demo.py", line 41, in <module>

    model = pr.LPR(args.cascade_model_path, args.mapping_vertical_model_path, args.ocr_plate_model_path)

  File "/home/yuy/Demo/HyperLPR/HyperLPRLite.py", line 19, in __init__

    self.modelSeqRec = self.model_seq_rec(model_seq_rec)

  File "/home/yuy/Demo/HyperLPR/HyperLPRLite.py", line 102, in model_seq_rec

    base_model.load_weights(model_path)

  File "/home/yuy/.virtualenvs/CarEnv/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 2211, in load_weights

    hdf5_format.load_weights_from_hdf5_group(f, self.layers)

  File "/home/yuy/.virtualenvs/CarEnv/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 698, in load_weights_from_hdf5_group

    layer, weight_values, original_keras_version, original_backend)

  File "/home/yuy/.virtualenvs/CarEnv/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 408, in preprocess_weights_for_loading

    return _convert_rnn_weights(layer, weights)

  File "/home/yuy/.virtualenvs/CarEnv/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 569, in _convert_rnn_weights

    raise ValueError('%s is not compatible with %s' % types)

ValueError: GRU(reset_after=False) is not compatible with GRU(reset_after=True)


正在回答

1 回答

那就用cpu 重新训练呗


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

老师,在GPU里训练的模型,在CPU里运行的程序调用,出错,怎么解决呢?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信