{"action":"created","issue":{"url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/37","repository_url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation","labels_url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/37/comments","events_url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/37/events","html_url":"https://github.com/jocicmarko/ultrasound-nerve-segmentation/issues/37","id":229092141,"number":37,"title":"Help to fix this error","user":{"login":"Guru-prasad","id":28592628,"avatar_url":"https://avatars3.githubusercontent.com/u/28592628?v=3","gravatar_id":"","url":"https://api.github.com/users/Guru-prasad","html_url":"https://github.com/Guru-prasad","followers_url":"https://api.github.com/users/Guru-prasad/followers","following_url":"https://api.github.com/users/Guru-prasad/following{/other_user}","gists_url":"https://api.github.com/users/Guru-prasad/gists{/gist_id}","starred_url":"https://api.github.com/users/Guru-prasad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guru-prasad/subscriptions","organizations_url":"https://api.github.com/users/Guru-prasad/orgs","repos_url":"https://api.github.com/users/Guru-prasad/repos","events_url":"https://api.github.com/users/Guru-prasad/events{/privacy}","received_events_url":"https://api.github.com/users/Guru-prasad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-16T16:23:21Z","updated_at":"2017-06-22T11:05:05Z","closed_at":null,"body":"Hi,\r\nthanks for replying regarding train.py\r\ni changed from python 3.5 to python 2.7\r\nnow i am getting following error:\r\n\r\n       71     conv6 = Conv2D(256, (3, 3), activation='relu', padding='same')(conv6)\r\n       72 \r\n---> 73     up7 = concatenate([UpSampling2D(size=(2, 2))(conv6), conv3], axis=3)\r\n        74     conv7 = Conv2D(128, (3, 3), activation='relu', padding='same')(up7)\r\n        75     conv7 = Conv2D(128, (3, 3), activation='relu', padding='same')(conv7)\r\n\r\nValueError: `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 0, 104, 256), (None, 0, 105, 128)]\r\n\r\ni have used theano backend.\r\n\r\nthe code is :\r\n`from __future__ import print_function\r\n\r\nimport os\r\nos.environ['KERAS_BACKEND']='theano'\r\nimport keras\r\nfrom skimage.transform import rotate, resize, rescale\r\n#from skimage.io import imsave\r\nfrom skimage.io import imsave, imread\r\nimport numpy as np\r\nfrom keras.models import Model\r\nfrom keras.layers import Input, concatenate, Conv2D, MaxPooling2D, UpSampling2D\r\nfrom keras.optimizers import Adam\r\nfrom keras.callbacks import ModelCheckpoint\r\nfrom keras import backend as K\r\nK.image_dim_ordering = 'th'\r\n\r\n#from data import load_train_data, load_test_data\r\n\r\nK.set_image_data_format('channels_last')  # TF dimension ordering in this code\r\n\r\nimg_rows = 420\r\nimg_cols = 580\r\n\r\nsmooth = 1.\r\n\r\ndef load_train_data():\r\n    imgs_train = np.load('imgs_train.npy')\r\n    imgs_mask_train = np.load('imgs_mask_train.npy')\r\n    return imgs_train, imgs_mask_train\r\n\r\ndef load_test_data():\r\n    imgs_test = np.load('imgs_test.npy')\r\n    imgs_id = np.load('imgs_id_test.npy')\r\n    return imgs_test, imgs_id\r\n\r\n\r\ndef dice_coef(y_true, y_pred):\r\n    y_true_f = K.flatten(y_true)\r\n    y_pred_f = K.flatten(y_pred)\r\n    intersection = K.sum(y_true_f * y_pred_f)\r\n    return (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth)\r\n\r\n\r\ndef dice_coef_loss(y_true, y_pred):\r\n    return -dice_coef(y_true, y_pred)\r\n\r\n\r\ndef get_unet():\r\n    inputs = Input((1, img_rows, img_cols))\r\n    conv1 = Conv2D(32, (3, 3), activation='relu', padding='same')(inputs)\r\n    conv1 = Conv2D(32, (3, 3), activation='relu', padding='same')(conv1)\r\n    pool1 = MaxPooling2D(pool_size=(2, 2))(conv1)\r\n\r\n    conv2 = Conv2D(64, (3, 3), activation='relu', padding='same')(pool1)\r\n    conv2 = Conv2D(64, (3, 3), activation='relu', padding='same')(conv2)\r\n    pool2 = MaxPooling2D(pool_size=(2, 2))(conv2)\r\n\r\n    conv3 = Conv2D(128, (3, 3), activation='relu', padding='same')(pool2)\r\n    conv3 = Conv2D(128, (3, 3), activation='relu', padding='same')(conv3)\r\n    pool3 = MaxPooling2D(pool_size=(2, 2))(conv3)\r\n\r\n    conv4 = Conv2D(256, (3, 3), activation='relu', padding='same')(pool3)\r\n    conv4 = Conv2D(256, (3, 3), activation='relu', padding='same')(conv4)\r\n    pool4 = MaxPooling2D(pool_size=(2, 2))(conv4)\r\n\r\n    conv5 = Conv2D(512, (3, 3), activation='relu', padding='same')(pool4)\r\n    conv5 = Conv2D(512, (3, 3), activation='relu', padding='same')(conv5)\r\n\r\n    up6 = concatenate([UpSampling2D(size=(2, 2))(conv5), conv4], axis=3)\r\n    conv6 = Conv2D(256, (3, 3), activation='relu', padding='same')(up6)\r\n    conv6 = Conv2D(256, (3, 3), activation='relu', padding='same')(conv6)\r\n\r\n    up7 = concatenate([UpSampling2D(size=(2, 2))(conv6), conv3], axis=3)\r\n    conv7 = Conv2D(128, (3, 3), activation='relu', padding='same')(up7)\r\n    conv7 = Conv2D(128, (3, 3), activation='relu', padding='same')(conv7)\r\n\r\n    up8 = concatenate([UpSampling2D(size=(2, 2))(conv7), conv2], axis=3)\r\n    conv8 = Conv2D(64, (3, 3), activation='relu', padding='same')(up8)\r\n    conv8 = Conv2D(64, (3, 3), activation='relu', padding='same')(conv8)\r\n\r\n    up9 = concatenate([UpSampling2D(size=(2, 2))(conv8), conv1], axis=3)\r\n    conv9 = Conv2D(32, (3, 3), activation='relu', padding='same')(up9)\r\n    conv9 = Conv2D(32, (3, 3), activation='relu', padding='same')(conv9)\r\n\r\n    conv10 = Conv2D(1, (1, 1), activation='sigmoid')(conv9)\r\n\r\n    model = Model(inputs=[inputs], outputs=[conv10])\r\n\r\n    model.compile(optimizer=Adam(lr=1e-5), loss=dice_coef_loss, metrics=[dice_coef])\r\n\r\n    return model`\r\n\r\nthanks in advance!!"},"comment":{"url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/comments/310348559","html_url":"https://github.com/jocicmarko/ultrasound-nerve-segmentation/issues/37#issuecomment-310348559","issue_url":"https://api.github.com/repos/jocicmarko/ultrasound-nerve-segmentation/issues/37","id":310348559,"user":{"login":"pratikgorji","id":18732165,"avatar_url":"https://avatars1.githubusercontent.com/u/18732165?v=3","gravatar_id":"","url":"https://api.github.com/users/pratikgorji","html_url":"https://github.com/pratikgorji","followers_url":"https://api.github.com/users/pratikgorji/followers","following_url":"https://api.github.com/users/pratikgorji/following{/other_user}","gists_url":"https://api.github.com/users/pratikgorji/gists{/gist_id}","starred_url":"https://api.github.com/users/pratikgorji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratikgorji/subscriptions","organizations_url":"https://api.github.com/users/pratikgorji/orgs","repos_url":"https://api.github.com/users/pratikgorji/repos","events_url":"https://api.github.com/users/pratikgorji/events{/privacy}","received_events_url":"https://api.github.com/users/pratikgorji/received_events","type":"User","site_admin":false},"created_at":"2017-06-22T11:05:05Z","updated_at":"2017-06-22T11:05:05Z","body":"Please reply !!\r\n"}}
{"actor":{"display_login":"pratikgorji"}}