lyakaap / kaggle-carvana-3rd-place-solution Goto Github PK
View Code? Open in Web Editor NEW3rd place solution ( Carvana Image Masking Challenge )
3rd place solution ( Carvana Image Masking Challenge )
Great stuff here. Any chance you could release the pretrained weights?
my doubt is regarding the implementation loss, which is a combination of binary cross entropy and dice loss(F score), what is the intuition behind combining both, BCE is loss and other is F score, please could you provide a reason or any reference.
I am new to Keras. After learning some tutorial on the internet, I tried to train. But always got a problem.
my training code is:
`train_datagen = image.ImageDataGenerator(
rotation_range=40,
width_shift_range=0.2,
height_shift_range=0.2,
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode='nearest')
val_datagen = image.ImageDataGenerator(rescale=1./255)
train_generator = train_datagen.flow_from_directory('../images/train/cat/',
target_size=(1920,1280),
batch_size=32,
class_mode='binary')
val_generator = val_datagen.flow_from_directory('../images/val/cat/',
target_size=(1920,1280),
batch_size=8,
class_mode='binary')
model.fit_generator(
train_generator,
steps_per_epoch=11250//32,
epochs=10,
validation_data=val_generator,
validation_steps=144)
model.save_weights('../models/pet.h5')`
and the error is:
`Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)
File "/home/hans/Kaggle/Fine-Grained/doc/fine-grained.py", line 98, in
validation_steps=144)
File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 2042, in fit_generator
class_weight=class_weight)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1762, in train_on_batch
outputs = self.train_function(ins)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2273, in call
**self.session_kwargs)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 961, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (32, 1) for Tensor u'conv2d_22_target:0', which has shape '(?, ?, ?, ?)'`
could you please tell me why the implement of loss function [weight_bce_dice_loss] is different from your kernel in kaggle : kernel
diff 1: weighted bce loss
[kaggle kernel]
loss = (1. - y_true) * logit_y_pred + (1. + (weight - 1.) * y_true) * \ (K.log(1. + K.exp(-K.abs(logit_y_pred))) + K.maximum(-logit_y_pred, 0.))
[github repo]
loss = weight * (logit_y_pred * (1. - y_true) + K.log(1. + K.exp(-K.abs(logit_y_pred))) + K.maximum(-logit_y_pred, 0.))
diff2: weightd bce dice loss
[kaggle kernel]
border = K.cast(K.greater(averaged_mask, 0.005), 'float32') * K.cast(K.less(averaged_mask, 0.995), 'float32')
[github repo]
weight = 5. * K.exp(-5. * K.abs(averaged_mask - 0.5))
The bottleneck function in model.py does the same for parallel and cascade mode
what does the meaning of weight w0 & w1 in loss function "weighted_bce_dice_loss"
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.