muyang0320 / tensorflow-deeplab-resnet-crf Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I can't find it.
hello, I have read part of the source code of these project, and I find the content in the inference.py module from line 54 to line 63, and I pasts it at here as following:
img_orig = tf.image.decode_jpeg(tf.read_file(args.img_path), channels=3)
# Convert RGB to BGR.
img_r, img_g, img_b = tf.split(axis=2, num_or_size_splits=3, value=img_orig)
img = tf.cast(tf.concat(axis=2, values=[img_b, img_g, img_r]), dtype=tf.float32)
# Extract mean.
img -= IMG_MEAN
# Create network.
net = DeepLabResNetModel({'data': tf.expand_dims(img, dim=0)}, is_training=False)
However, as far as my concern, to utilize a trained model to do inference, the most common way should be like that:
(1) build the network and load the network weight param got from the previous trainning
(2)input the image for inference
anyway, according to the source code like above, the input image for inferencing was utilized as the parameter for the network initialization.
My question is, why did the input image should be utilized as a parameter for the networkinitialization, can I init the network alone without it, so as to executing the inference of this model more
efficiently(I means, initializinig the model at beginning only once, and to do the inference of several images one by one next)
Thank for your help.
thanks for your brilliant code! i can't find the module "pydensercf" in deeplab_resnet/utils.py . How to fix it ?
Hello, I can not find the file of pydensecrf ? Thank you!
I tried running train.py and I've got the following error:
Traceback (most recent call last):
File "train.py", line 187, in
main()
File "train.py", line 105, in main
coord)
File "C:\Users\Matheus\Desktop\UFRGS\Mestrado\tutorial_python\APLICACAO_A_AGRICULTURA\tensorflow-deeplab-resnet-crf-master\deeplab_resnet\image_reader.py", line 95, in init
self.image, self.label = read_images_from_disk(self.queue, self.input_size, random_scale)
File "C:\Users\Matheus\Desktop\UFRGS\Mestrado\tutorial_python\APLICACAO_A_AGRICULTURA\tensorflow-deeplab-resnet-crf-master\deeplab_resnet\image_reader.py", line 64, in read_images_from_disk
img = tf.cast(tf.concat(2, [img_b, img_g, img_r]), dtype=tf.int32)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1172, in concat
dtype=dtypes.int32).get_shape().assert_is_compatible_with(
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 946, in convert_to_tensor
as_ref=False)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1036, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 235, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 214, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 433, in make_tensor_proto
_AssertCompatible(values, dtype)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 344, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
Can you help me? =(
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.