{"QuestionId":52586526,"AnswerCount":1,"Tags":"","CreationDate":"2018-10-01T07:40:08.327","AcceptedAnswerId":52596030.0,"OwnerUserId":10345968.0,"Title":"Caffe model fails to learn","Body":"

I have the following convolutional model implemented in Keras, where after training for 100,000 epoch, it shows excellent performance with greate accuracy.<\/p>\n\n

<\/pre>\n\n

However after trying to implement the same model in Caffe, it fails to train with an almost fixed loss value >=2.1 && <=2.6. \nHere is my Caffe prototext implementation:<\/p>\n\n

<\/pre>\n\n

And here is my model solver (hyper-parameters):<\/p>\n\n

<\/pre>\n\n

I believe that if i have no problem translating the model into Caffe, then it should performs the same way it do in Keras, so i think i had missed something.\nAny help would be appreciated, thanks.<\/p>\n","answers":[{"AnswerId":"52596030","CreationDate":"2018-10-01T17:27:00.517","ParentId":null,"OwnerUserId":"3802483","Title":null,"Body":"

poly: the effective learning rate follows a polynomial decay, to be\n\/\/ zero by the max_iter. return base_lr (1 - iter\/max_iter) ^ (power)<\/p>\n\n

So basically, are you sure you want to keep power set to 0.5 in\nreturns base_lr (1 - iter\/max_iter) ^ (power)? I think that might be the problem as you are decaying to minus something, try 2?<\/p>\n"}]} {"QuestionId":52586787,"AnswerCount":0,"Tags":"","CreationDate":"2018-10-01T07:58:27.707","AcceptedAnswerId":null,"OwnerUserId":6933148.0,"Title":"How to solve the tensorflow's Conv2d layer error: \"self.kernel_size[i], IndexError: tuple index out of range\"?","Body":"

I'm running my programs with and \nI have the following model architecture:<\/p>\n\n

<\/pre>\n\n

But arriving at the layer, I've got the following error:<\/p>\n\n

\n

Traceback (most recent call last):<\/p>\n \n

\n

File\n \"\/usr\/local\/lib\/python3.5\/dist-packages\/IPython\/core\/interactiveshell.py\",\n line 2910, in run_code\n exec(code_obj, self.user_global_ns, self.user_ns) File \"\", line 1, in \n cross = Conv2D(1, 3, activation='relu', name=\"conv\", padding='same')(cross) File\n \"\/usr\/local\/lib\/python3.5\/dist-packages\/keras\/engine\/base_layer.py\",\n line 474, in call<\/strong>\n output_shape = self.compute_output_shape(input_shape) File \"\/usr\/local\/lib\/python3.5\/dist-packages\/keras\/layers\/convolutional.py\",\n line 195, in compute_output_shape\n self.kernel_size[i], IndexError: tuple index out of range<\/p>\n <\/blockquote>\n<\/blockquote>\n\n

I saw here<\/a> solutions related to the keras version, but I don't think it's the same here, because my keras version worked well with another program that uses the same layer .\n Anyone can give me some tips, please?\nThanks in advance<\/p>\n","answers":[]} {"QuestionId":52586853,"AnswerCount":1,"Tags":"","CreationDate":"2018-10-01T08:03:07.277","AcceptedAnswerId":null,"OwnerUserId":785041.0,"Title":"Batchnormalization nodes wrongfully linked with each other","Body":"

I'm training a Keras network using BatchNormalization layers and saw a strange thing looking at the TensorBoard graph. My network consists of a stack of 1D convolutions followed by BatchNormalization layers. Most of the graph seems fine, but the very first BatchNormalization layer is - according to TensorBoard - sending information to all other BatchNormalization layers. Is this normal?<\/p>\n\n

Here's the output of the network according to Keras <\/p>\n\n

<\/pre>\n\n

And here's (part of) the graph shown in TensorBoard \"graph\"\n(If the image is not visible, please go to this link: https:\/\/imgur.com\/a\/G74uIWE<\/a>)\nZoomed version: \"zoomed_graph\" or this link: https:\/\/imgur.com\/a\/vtF3VWb<\/a> <\/p>\n\n

The red-outlined layer is the very first batch normalization layer I made in the network (batchnorm_0_0). I don't know much about the inner workings of a batchnormalization layer but I find it odd that it is linked to all other BN-layers, while those other BN-layers do not (they just are connected to the input\/output I assigned them).\nI'm wondering if this is a bug in my code, in keras, or maybe in TensorBoard?<\/p>\n\n

Update:<\/strong> model's code below; it's written in a way I can easily experiment with the number of convolution layers\/filters, etc... but should be rather explanatory.<\/p>\n\n

<\/pre>\n\n

Kind regards,<\/p>\n\n

steven<\/p>\n","answers":[{"AnswerId":"52984880","CreationDate":"2018-10-25T08:37:17.550","ParentId":null,"OwnerUserId":"785041","Title":null,"Body":"

A cautious answer to my own question, @Mike, I think (hope?) this is indeed a bug on the tensorboard side as I can't explain it otherwise. <\/p>\n\n

I plotted the architecture using keras.utils.plot_model<\/code> and this also doesn't show any links between the BatchNormalization layers.<\/p>\n"}]} {"QuestionId":52587151,"AnswerCount":0,"Tags":"","CreationDate":"2018-10-01T08:24:03.867","AcceptedAnswerId":null,"OwnerUserId":10439898.0,"Title":"tensorflow - how to input a directory by dataset api","Body":"

I am new to tensorflow, and here is my situation: I have lots of folders and each contains several images. I need my training input to be folders(each time 2 folders), and each time 4 images inside a folder be selected for training.\nI have tried Dataset api, and tried to use the or function, but I failed to read images inside a folder.\nHere is part of my codes:<\/p>\n\n

<\/pre>\n\n

where filename is a list of folder name like '123456', labels is list of label like 0 or 1.<\/p>\n","answers":[]} {"QuestionId":52587227,"AnswerCount":1,"Tags":"","CreationDate":"2018-10-01T08:29:47.663","AcceptedAnswerId":null,"OwnerUserId":9900971.0,"Title":"how to install pytorch version 0.1.12 in anaconda 3.6 windows 10?","Body":"

Tried to install with this command but still didn't work-> conda install -c peterjc123 pytorch=0.1.12<\/p>\n\n

Also tried installing using this command:\nconda install pytorch=0.1.12 -c pytorch\nHow can it be installed with python anaconda 3.6?<\/p>\n","answers":[{"AnswerId":"52588937","CreationDate":"2018-10-01T10:14:33.370","ParentId":null,"OwnerUserId":"6390175","Title":null,"Body":"

First of all, make sure that Python 3.5 or later<\/code> is installed as well.<\/p>\n\n