{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/CNTK/issues/1006","repository_url":"https://api.github.com/repos/Microsoft/CNTK","labels_url":"https://api.github.com/repos/Microsoft/CNTK/issues/1006/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/CNTK/issues/1006/comments","events_url":"https://api.github.com/repos/Microsoft/CNTK/issues/1006/events","html_url":"https://github.com/Microsoft/CNTK/issues/1006","id":187669481,"number":1006,"title":"RuntimeError: Left operand's shape [192 x 32 x 32] is not compatible with right operand's shape [64 x 1 x 1] for the binary elementwise operation Plus","user":{"login":"kyu899","id":5562120,"avatar_url":"https://avatars.githubusercontent.com/u/5562120?v=3","gravatar_id":"","url":"https://api.github.com/users/kyu899","html_url":"https://github.com/kyu899","followers_url":"https://api.github.com/users/kyu899/followers","following_url":"https://api.github.com/users/kyu899/following{/other_user}","gists_url":"https://api.github.com/users/kyu899/gists{/gist_id}","starred_url":"https://api.github.com/users/kyu899/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyu899/subscriptions","organizations_url":"https://api.github.com/users/kyu899/orgs","repos_url":"https://api.github.com/users/kyu899/repos","events_url":"https://api.github.com/users/kyu899/events{/privacy}","received_events_url":"https://api.github.com/users/kyu899/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-07T10:03:33Z","updated_at":"2016-11-07T10:03:33Z","closed_at":null,"body":"Hi.\r\nI am trying to train a CNN model with CIFAR-10 dataset, and then re-use it to learn another training data (it is also images in CIFAR-10).\r\nI use Python with CNTK.\r\nThe following is my scripts:\r\n\r\n.............\r\n\r\nimage_height = 32\r\nimage_width  = 32\r\nnum_channels = 3\r\nnum_classes  = 10\r\n\r\ninput_var = input_variable((num_channels, image_height, image_width))\r\nlabel_var = input_variable((num_classes))\r\n\r\na = Convolution((3, 3), 64, activation=relu, pad=True)\r\nb = Convolution((3, 3), 64, activation=relu, pad=True)(a)\r\nc = MaxPooling((3,3), strides=(2,2))(b)\r\nd = Convolution((3, 3), 96, activation=relu, pad=True)(c) \r\ne = Convolution((3, 3), 96, activation=relu, pad=True)(d)\r\nf = MaxPooling((3,3), strides=(2,2))(e)\r\nh = Convolution((3, 3), 128, activation=relu, pad=True)(f)\r\ni = Convolution((3, 3), 128, activation=relu, pad=True)(h)\r\nj = MaxPooling((3, 3), strides=(2, 2))(i)\r\nk = Dense(1024, activation=relu)(j)\r\nl = Dropout(0.5)(k)\r\nm = Dense(1024, activation=relu)(l)\r\nn = Dropout(0.5)(m)\r\n\r\nz = Dense(num_classes, activation = None)(n)\r\nz = z(input_var)\r\n\r\n..........\r\n\r\nand the training was successful.\r\nThen I tried to re-use the model, except the last layer, i.e., z = Dense(num_classes, activation = None)(n), as follows:\r\n\r\n..........\r\ninput_var2 = input_variable((num_channels, image_height, image_width))\r\nlabel_var2 = input_variable((num_classes))\r\n\r\nanother = Dense(num_classes, activation = None)(n)\r\nanother = another(input_var2)\r\n\r\nHowever, the last script returns runtime error.\r\nThe error messages are as follows:\r\n\r\n  File \"C:/repos/CNTK/bindings/python/examples/CifarConvNet/CifarConvNet3.py\", line 175, in train_and_evaluate\r\n    another = another(input_var2)\r\n  File \"C:\\Python34\\lib\\site-packages\\cntk\\ops\\functions.py\", line 82, in __call__\r\n    return self.clone(CloneMethod.share, dict(zip(placeholders, args)))\r\n  File \"C:\\Python34\\lib\\site-packages\\cntk\\utils\\swig_helper.py\", line 52, in wrapper\r\n    result = f(*args, **kwds)\r\n  File \"C:\\Python34\\lib\\site-packages\\cntk\\ops\\functions.py\", line 146, in clone\r\n    return super(Function, self).clone(method, substitutions)\r\n  File \"C:\\Python34\\lib\\site-packages\\cntk\\cntk_py.py\", line 1052, in clone\r\n    return _cntk_py.Function_clone(self, *args)\r\nRuntimeError: Left operand's shape [192 x 32 x 32] is not compatible with right operand's shape [64 x 1 x 1] for the binary elementwise operation Plus\r\n\r\n\r\nI want to know what I've done wrong and get your feedback.\r\n\r\nThank you.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n "}}
{"actor":{"display_login":"kyu899"}}