Open chiyandetaotie opened 5 years ago
Hello, I have updated the description of the weights section. The link to download them is : http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel
Hi, @RaphaelGinoulhac , Thank you very much for your reply. Could you tell me how to convert the file "VGG_ILSVRC_16_layers.caffemodel " to the " vgg16.npy ", compatible with TensorFlow. Or if you are convenient, can you give me the converted "vgg16.npy" to make the code work ?
In scannet_train_tf.py, starting at line 42: trainer.train( imsize = imsize, batch_size=batch_size, input_ch = input_ch, epoch_nbr = epoch_nbr, net_weights_init = vgg_weight_init, dir_images = dir_images, saver_directory = saver_directory_rgb, images_root = "rgb", label_nbr = label_nbr, learning_rate = learning_rate, variable_scope="rgb")
Thus, the train method of trainer takes the vgg_weights as an argument. I think it handles the .caffemodel file. If you want to use another method to import the weights, I don't know !
Hi, @RaphaelGinoulhac , Thank you very much for your reply. I have downloaded the file "VGG_ILSVRC_16_layers.caffemodel" from the link, but it does not work. It shows : Failed to interpret file '/home/yl/snapnet-master/vgg_weight_init/VGG_ILSVRC_16_layers.caffemodel' as a pickle " I think the code need the " .npy" to run .In your releaseded config.json (https://github.com/RaphaelGinoulhac/SnapNetPonts/blob/master/config.json):
"vgg_weight_init":"/home/eleves/Documents/projet_class_3D/Snapnet_git/VGG_ILSVRC_16_layers.npy" It is " .npy" rather than " .caffemodel "
And in the tensorflow_unet.py, starting at line 70:
def load(self, filename, variable_scope, session): with tf.variable_scope(variable_scope) as scope: data_dict = np.load(filename, encoding="bytes").tolist() for op_name in data_dict: with tf.variable_scope(op_name, reuse=True): for param_name, data in data_dict[op_name].items(): param_name = param_name.decode('utf-8') try: var = tf.get_variable(param_name) session.run(var.assign(data)) except ValueError: print("Error", op_name, param_name)
# raise
It use the " np.load " to load the file ,so I think the code needs the file " .npy ". But I do not have it and I do not know how to convert the file " .caffemodel " to the " .npy ", compatible with TensorFlow. I do not know if it needs the file " .npy " or not .I do not know how to make it work.
Looking forward to receiving your early reply.
You're right, however I can't recall how I converted the .caffemodel file into a .npy. A quick google search yields : https://github.com/nilboy/extract-caffe-params and https://ndres.me/post/convert-caffe-to-tensorflow/
Hi, @RaphaelGinoulhac ,
Thanks for releasing this package.The link for downloading the *.npy file of the VGG weights seems to be broken. Is there any other place where I can get it?