Giter VIP home page Giter VIP logo

refinenet-keras's People

Contributors

attila94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

refinenet-keras's Issues

wrong function

I think there is somthing wrong with your ChainedResidualPooling function...
Maybe you can check it again.

ValueError: Operands could not be broadcast together with shapes (18, 18, 256) (17, 17, 256)

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.

2 classes training gives solid black image

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?

Confusion in the weights file

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,

Structure of images and labels in dataset

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.

inference.py - # Import classes from csv file

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!

error during run inference.py

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?

Run inference.py and error is Operands could not be broadcast together with shapes

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)

Transfer Learning of the model for PASCAL VOC dataset

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.