attila94 / refinenet-keras Goto Github PK
View Code? Open in Web Editor NEWRefineNet: a Keras implementation
RefineNet: a Keras implementation
I think there is somthing wrong with your ChainedResidualPooling function...
Maybe you can check it again.
Hi,
Thank you for sharing your work.
Sorry to bother you, as I see no issues related to my error, I assume the error is mine.
After severals tries to fix it, I think I rather ask it.
The line: model = build_refinenet(input_shape, num_class, resnet_weights = frontend_weights, frontend_trainable = frontend_trainable) gives me an error I am unavle to solve.
The build refinenet function is able to read call and terurn the resnet101 model and prints: "Frontend weights loaded." After that it reads in all the high inputs, and low[0], but line 194 goes wrong. See full error log:
Traceback (most recent call last):
File "C:/Users/KatrinKostova/refinenet-keras/train.py", line 80, in
model = build_refinenet(input_shape, num_class, resnet_weights = frontend_weights, frontend_trainable = frontend_trainable)
File "C:\Users\KatrinKostova\refinenet-keras\model\refinenet.py", line 194, in build_refinenet
low[1] = RefineBlock(high_inputs = high[1], low_inputs = low[0], block=3) # High input = ResNet 1/16, Low input = Previous 1/16
File "C:\Users\KatrinKostova\refinenet-keras\model\refinenet.py", line 155, in RefineBlock
name = 'rb_{}mrf'.format(block))
File "C:\Users\KatrinKostova\refinenet-keras\model\refinenet.py", line 110, in MultiResolutionFusion
return Add(name=name+'sum')([conv_low_up, conv_high])
File "C:\Users\KatrinKostova\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\base_layer.py", line 431, in call
self.build(unpack_singleton(input_shapes))
File "C:\Users\KatrinKostova\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\layers\merge.py", line 91, in build
shape)
File "C:\Users\KatrinKostova\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\layers\merge.py", line 61, in _compute_elemwise_op_output_shape
str(shape1) + ' ' + str(shape2))
ValueError: Operands could not be broadcast together with shapes (18, 18, 256) (17, 17, 256)
Process finished with exit code 1
I dont know where 17 and 18 comes from. Did this problem occur to someone else too? Thank you in advance.
Thank you for sharing your code!
I am trying to train my own dataset which includes only 2 classes (hand rgb:255 255 255, background rgb:0,0,0). I did not use the pre-trained file. I arrange the dataset as you instruct but the result during the train is a black image. I trained the model more than 100 epochs and the loss is around 0.73130.
Any ideas or suggestions?
Hi,
Thank you for sharing your work.
Sorry to bother you, as I see no issues related to my error, I assume the error is mine.
After severals tries to fix it, I think I rather ask it.
I'm facing a recurrent issue between the weights files for pre-trained model.
ValueError: You are trying to load a weight file containing 304 layers into a model with 393 layers.
(number 304 vary to 360 if i adress the refinenet weight filepath, either refinenet_baseline.hdf5 or weights.35-0.14.hdf5).
In your readme.md/Inference you mention:
"Specify paths to resnet101_weights_tf.h5, RefineNet weights file and your dataset base in inference.py"
I see here only one path to adjust : 'weights', with no distinction between resnet's weights and refinenet's ones
I had a look to your commit history, and saw that you modified your weights vars, precedently distinguished for resnet and refinenet. Even by looking close to your code, I'm not able to find the solution.
Could you explicitly tell me which filepath have I to write in weights var in inference.py?
Best,
Just want to know the structure of images and labels for each of the training, validation and testing folders in the dataset. I am assuming images folder contains the images whereas the labels folder is a .txt or .csv file containing the class labels of the images. My doubt does the name of the image in images folder should be it's corresponding class label.
Can the resnet50 provided in keras applications be used as the backbone?
Hi Attila,
Sorry to bother you again. This issue is related to the import from csv file:
class_names_list, mask_colors, num_class, class_names_string = get_label_info(class_dict)
So you want to read in 4 variables form the output of the function get_label_info from scripts.helpers, but that function returns 2 items and not 4:
return label_values, len(label_values)
So I changed it to the line below, but my output images are all black.
return label_values, label_values, len(label_values), class_names_string
I am wondering how this should be solved. Thanks in advance!
sorry for bothering,
I downloaded the h5 file and run inference.py
but I suffered a ValueError
ValueError: You are trying to load a weight file containing 360 layers into a model with 393 layers.
Can you help me?
Think its my fault, but may be you give me any route?
My error is:
tracking <tf.Variable 'scale5c_branch2b/scale5c_branch2b_beta:0' shape=(512,) dtype=float32> beta
tracking <tf.Variable 'scale5c_branch2c/scale5c_branch2c_gamma:0' shape=(2048,) dtype=float32> gamma
tracking <tf.Variable 'scale5c_branch2c/scale5c_branch2c_beta:0' shape=(2048,) dtype=float32> beta
Traceback (most recent call last):
File "D:\-inst\Python\Python373\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "D:\-inst\Python\Python373\lib\site-packages\tensorflow\python\framework\ops.py", line 5652, in get_controller
yield g
File "D:\-inst\Python\Python373\lib\site-packages\keras\engine\base_layer.py", line 463, in __call__
self.build(unpack_singleton(input_shapes))
File "D:\-inst\Python\Python373\lib\site-packages\keras\layers\merge.py", line 91, in build
shape)
File "D:\-inst\Python\Python373\lib\site-packages\keras\layers\merge.py", line 61, in _compute_elemwise_op_output_shape
str(shape1) + ' ' + str(shape2))
ValueError: Operands could not be broadcast together with shapes (136, 240, 256) (135, 240, 256)
Thank you for responding to my previous query in the other issue. I want to apply transfer learning to the model for PASCAL VOC dataset. I have used the weights file you have provided for CityScapes dataset as the initial weights for the model. I have only changed the number of classes which is only used at the last layer. But when I tried to see some initial predictions, all I see are a bunch 0's and 1's (basically some noise). I have also changed the activation function in the final layer to 'Sigmoid'. I thought I should get some basic segmentation results as the model is pretrained with CityScapes dataset but it didn't happen. Do you think it is because of the usage of the 'Sigmoid' activation function? Do we have to use only 'Softmax' activation for segmentation tasks? For PASCAL VOC, each image contains multiple objects and I see CityScapes also contains multiple objects.
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.