qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading weights in local

Le0Dev opened this issue · comments

Hello everyone,

I'm currently using the segmentation_models lib for semantic segmentation on medical images.
More precisely, I use U-net with a Resnet34 backbone. When I run my code on my personal computer, everything works fine.
However, I tried to use the same code on a server with GPU but I have issues when downloading the resnet34_imagenet_no_top.h5 file.

The issue happen when I run this cell:

BACKBONE = 'resnet34'
model = sm.Unet(BACKBONE, encoder_weights='imagenet',
            input_shape=(IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS),
            classes=n_classes, activation='softmax')
model.compile('Adam', loss=sm.categorical_focal_dice_loss, metrics=[sm.metrics.iou_score])

I obtain TimeOutError, URLError and this at the end of the error message:

Exception: URL fetch failure on 
https://github.com/qubvel/classification_models/releases/download/0.0.1/resnet34_imagenet_1000_no_top.h5: None -- [WinError 
10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established 
connection failed because connected host has failed to respond

I guess it comes from the proxy of my company. I would like to know if there is a way to load the resnet34_imagenet_no_top.h5 in local, without having sm.Unet() to download the file.

Thanks by advance