hikapok / tf-senet Goto Github PK
View Code? Open in Web Editor NEWSE_ResNet && SE_ResNeXt with pretrained weights on ImageNet (SENet In TensorFlow)
License: Apache License 2.0
SE_ResNet && SE_ResNeXt with pretrained weights on ImageNet (SENet In TensorFlow)
License: Apache License 2.0
tensorflow.python.framework.errors_impl.NotFoundError: Key conv1/7x7_s2/bn/beta/Momentum not found in checkpoint │·············································
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/│·············································
Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]] │·············································
[[Node: save/RestoreV2/_301 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_│·············································
name="edge_306_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]] │·············································
│·············································
Caused by op 'save/RestoreV2', defined at: │·············································
File "SE_resnext.py", line 272, in │·············································
saver = tf.train.Saver(tf.global_variables()) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1311, in init │·············································
self.build() │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1320, in build │·············································
self._build(self._filename, build_save=True, build_restore=True) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1357, in _build │·············································
build_save=build_save, build_restore=build_restore) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 809, in _build_internal │·············································
restore_sequentially, reshape) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 448, in _AddRestoreOps │·············································
restore_sequentially) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 860, in bulk_restore │·············································
return io_ops.restore_v2(filename_tensor, names, slices, dtypes) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1458, in restore_v2 │·············································
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper │·············································
op_def=op_def) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3290, in create_op │·············································
op_def=op_def) │·············································
File "/vol/venvs/tf1.7/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1654, in init │·············································
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access │·············································
│·············································
NotFoundError (see above for traceback): Key conv1/7x7_s2/bn/beta/Momentum not found in checkpoint │·············································
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/│·············································
Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]] │·············································
[[Node: save/RestoreV2/_301 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_│·············································
name="edge_306_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Hello, I'm focusing on convert se-resnet model from caffe to tensorflow? But I met some issues, could you share your "post-processing"? thanks :)
about the image preprocessing, i did not get your point, can you tell more details
I want to classify an image, but the result is not correct. What is wrong with the operation?
input_image = tf.placeholder(tf.float32, shape=(None, 3, 224, 224), name='input_placeholder')
outputs = SE_ResNet(input_image, 1000, is_training=False, data_format='channels_first')
saver = tf.train.Saver()
with tf.Session() as sess:
init = tf.global_variables_initializer()
sess.run(init)
saver.restore(sess, "./seresnet50/se_resnet50.ckpt")
img = cv2.imread('./person.jpg')
img = cv2.resize(img, (224, 224))
img = np.array(img, np.float32)
img -= np.array([[[104., 117., 123.]]])
img = np.transpose(img, (2, 0, 1))
predict = sess.run(outputs, feed_dict={input_image: np.expand_dims(img, axis=0)})
print(predict)
print(np.argmax(predict))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.