xy0806 / miccai17-mmwhs-hybrid

If the code is helpful for your work, please cite our paper "Hybrid Loss Guided Convolutional Networks for Whole Heart Parsing" in STACOM Workshop of MICCAI 2017.
82 stars 25 forks source link

Problems loading the model #9

Open steve2ag opened 5 years ago

steve2ag commented 5 years ago

I´ve been trying to load the model with the weigths. I use the following commands

with tf.Session() as sess:

Obtaining the graph

saver = tf.train.import_meta_graph('checkpoint/1_96/ds_ft_hybrid_4ct.model-34000.meta')

Restoring the weights

saver.restore(sess,'checkpoint/1_96')

The problem arises while restoring the weigths. I keep getting the following error

InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Cannot assign a device for operation deconv1_1/deconv/filter/Initializer/random_normal/RandomStandardNormal: node deconv1_1/deconv/filter/Initializer/random_normal/RandomStandardNormal (defined at :3) was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:GPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0, /job:localhost/replica:0/task:0/device:XLA_GPU:0 ]. Make sure the device specification refers to a valid device. [[deconv1_1/deconv/filter/Initializer/random_normal/RandomStandardNormal]]

It would bee a lot of help if sameone could tell me if I´m doing something wrong Thanks beforehand for your help, and congratulations for your grat work.