JanMarcelKezmann / TensorFlow-Advanced-Segmentation-Models

A Python Library for High-Level Semantic Segmentation Models based on TensorFlow and Keras with pretrained backbones.
Other
151 stars 46 forks source link

error in tf_backbones.py #13

Closed HamidrezaHayatjou closed 2 years ago

HamidrezaHayatjou commented 2 years ago

Hi. I was running TASM_Example_2.ipynb and got this error. There is still error when I change the backbone name.

NameError Traceback (most recent call last)

in () ----> 1 base_model, layers, layer_names = tasm.create_base_model(name=BACKBONE_NAME, weights=WEIGHTS, height=HEIGHT, width=WIDTH, include_top=False, pooling=None) 2 3 BACKBONE_TRAINABLE = False 4 model = tasm.DANet(n_classes=N_CLASSES, base_model=base_model, output_layers=layers, backbone_trainable=BACKBONE_TRAINABLE) /content/drive/My Drive/cityscape/TensorFlow-Advanced-Segmentation-Models/tensorflow_advanced_segmentation_models/backbones/tf_backbones.py in create_base_model(name, weights, height, width, channels, include_top, pooling, alpha, depth_multiplier, dropout) 91 if height <= 31 or width <= 31: 92 raise ValueError("Parameters 'height' and 'width' should not be smaller than 32.") ---> 93 base_model = tf.keras.applications.ResNet50(include_top=include_top, weights=weights, input_shape=input_shape, pooling=pooling) 94 layer_names = ["conv1_relu", "conv2_block3_out", "conv3_block4_out", "conv4_block6_out", "conv5_block3_out"] 95 elif name.lower() == "resnet50v2": NameError: name 'tf' is not defined
JanMarcelKezmann commented 2 years ago

Hi @hamidhayatjou ,

unfortunately I deleted the import statement with my last push, I fixed the bug. It should work now properly again.

HamidrezaHayatjou commented 2 years ago

Thanks