Skip to content

Problems when I load the pretrained model #11

@douyh

Description

@douyh

I know very little about tensorflow.

I use this code...from the Internet... and try to load the pretrained model W30.

  import tensorflow as tf
  from net.model import HRNet
  import horovod.tensorflow as hvd
  
  
  def load_model(meta, checkpoint_dir):

       with tf.Session() as sess:
          saver = tf.train.import_meta_graph(meta)
          saver.restore(sess, tf.train.latest_checkpoint(checkpoint_dir))
          # graph = tf.get_default_graph()
          # fc = graph.get_tensor_by_name('final_dense')
          # print(fc.shape)
 
 
 
  if __name__ == "__main__":
      load_model('model/model.ckpt-1000000.meta', 'model')

I got an error
image

I add import horovod.tensorflow as hvd because I met a KeyError 'HorovodAllreduce'

horovod/horovod#594

What should I do? Thanks for your reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions