{"QuestionId": 36550131, "AnswerCount": 2, "Tags": " I received the following error while I was training the data. I have tried all the solutions given on the internet and nothing seems to work for me. I have checked paths and size of the lmdb files are non-zero. But the problem still exists. I have no idea how to solve this issue. Below is my file settings: So in Node I can execute a JavaScript file using a command like: But is there a way to execute all of the JavaScript files in a given directory synchronously (one file executes, then after it has finished the next one executes, etc)? Basically, is there a single command that would have the effect of something like I've tried commands like but with no success. If there exists no such command, what's the best way to go about doing something like this? I am currently trying to implement FCN for semantic segmentation in TensorFlow as it was previously done in Caffe here. Unfortunately I'm struggling with following 3 things: 1) How to map \"Deconvolution\" layer from Caffe to TensorFlow? Is it correctly 2) How to map \"Crop\" layer from Caffe to TensorFlow? Unfortunately I can't see any alternative in TensorFlow. Is there equivalent for this in TensorFlow? 3) Does Caffe Thank you in advance for any advices, hints and help. EDIT 9th May 2016: 1) I have found out that 2) Crop layer for now seems to be really a problem. I have found out that there actually exists Some more information might be on: https://github.com/tensorflow/tensorflow/issues/2049 EDIT 17th May 2016: I have followed @24hours advice and build FCN in tensorflow, though I was not able to make it train on data of the arbitrary size. 2) Crop layer is really not needed. 3) I have used I am trying to feed a Tensor containing the correct labels when I perform training. The correct labels for the entire training dataset are contained in one tensor which has been converted from a numpy array: I have a placeholder for the correct labels for each batch: During each training step, I slice the corresponding portion of This generates the error: Shape of variables I don't understand what is going wrong? Apparently it is something to do with the numpy - but now that I have converted the numpy array to a tensor, does that affect anything? Help and insight are much appreciated. Thank you! My folder structure is as follows: Now, I wish to use eslint angular only for the client folder whereas I wish to use airbnb base for the other folders that are not inside the client folder. I have two Client folder configuration looks like: whereas the one in the root folder looks like: Now, in the root folder, when I run However, if I go inside the client folder and run the esling command inside it, it seems to use the correct configuration. How do I configure it so that only client folder uses the angular eslint whereas the other folders use the airbnb one? C++11 brought support for so-called \"generalized attributes\", along with two standard ones, In practice, both gcc and clang have warnings regarding this situation that may be disabled. In particular, gcc gives the warning Why do I ask this? Well, some implementation-specific attributes are interesting. Take, for example, GCC's If the implementation knows about the attribute, everything's fine. But what can we expect if it doesn't? It ignores it and this behavior is backed by the standard. We can go on and add every interesting attribute we find in online docs. In particular, this would allow mixing It complains about it and this behavior is backed by the standard. D'oh! We'll have to roll some ugly machinery to keep unknown attributes from the hands of those pesky implementations. With just one attribute, it's easy, as empty attribute lists are allowed by the standard: However, with more than one attribute, things become more tricky: The even-uglier solution that comes to mind is to have macros that combine attributes, like this: But I would be shot in the head for this Thus, if the standard mandated that implementations ignore unknown attributes, I could pick every relevant attribute I found in online docs without fear and without ugly solutions \u2014 hence my interest. I'm reading a book.. and now I get the problem :\n\"(1) no such column: FAVORITE\" I tried so many things.. it always says : no such column.. I really dunno where the problem is.. cant find it. Thanks a lot. The MainActivity.::::: I'm using Anaconda Python 2.7 on windows 10 I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip installed graphviz and pydot. Now when I try run the following: or any sort of \"from keras.\" , I get the error: I have uninstalled and reinstalled Keras, Graphviz and pydot. i am using the development version of theano. I cannot find a fix. P.S If I uninstall graphviz and pydot, keras works again EDIT After uninstalling anaconda and reinstalling it including theano, keras, graphviz and pydot I now get the following error: I used I am trying to pass my object from Angular2 through a post to an MVC Controller. I was hoping I could pass the actual object in, but all of my properties are appearing as null when it gets into my controller. Is it possible to pass the entire object in? I also tried with \"UrlSearchParameters\" but it didnt work either. Here's my controller post function: Here's my client type:
\n\npooling_\nI0411 12:42:53.114141 21769 layer_factory.hpp:77] Creating layer data\nI0411 12:42:53.114586 21769 net.cpp:91] Creating Layer data\nI0411 12:42:53.114604 21769 net.cpp:399] data -> data\nI0411 12:42:53.114645 21769 net.cpp:399] data -> label\nF0411 12:42:53.114650 21772 db_lmdb.hpp:14] Check failed: mdb_status == 0 (2 \nvs. 0) No such file or directory\n*** Check failure stack trace: ***\nI0411 12:42:53.114673 21769 data_transformer.cpp:25] Loading mean file from: \n/home/Documents/Test/Images300/train_image_mean.binaryproto\n@ 0x7fa9436a3daa (unknown)\n@ 0x7fa9436a3ce4 (unknown)\n@ 0x7fa9436a36e6 (unknown)\n@ 0x7fa9436a6687 (unknown)\n@ 0x7fa943b0472e caffe::db::LMDB::Open()\n@ 0x7fa943afc644 caffe::DataReader::Body::InternalThreadEntry()\n@ 0x7fa940e46a4a (unknown)\n@ 0x7fa9406fe182 start_thread\n@ 0x7fa942a8a47d (unknown)\n@ (nil) (unknown)\nAborted (core dumped)\n
\n", "Lable": "D"}
{"QuestionId": 36585880, "AnswerCount": 4, "Tags": "name: \"GoogleNet\"\nlayer {\n name: \"data\"\n type: \"Data\"\n top: \"data\"\n top: \"label\"\n include {\n phase: TRAIN\n }\n transform_param {\n mirror: true\n crop_size: 224\n mean_file: \"/home/Documents/Test/Images300/train_image_mean.binaryproto\"\n }\n data_param {\n source: \"/home/caffe/examples/zImageDetection/ImageDetection_train_lmdb\"\n batch_size: 32\n backend: LMDB\n }\n}\nlayer {\n name: \"data\"\n type: \"Data\"\n top: \"data\"\n top: \"label\"\n include {\n phase: TEST\n }\n transform_param {\n mirror: false\n crop_size: 224\n mean_file: \"/home/Documents/Test/Image300/test_image_mean.binaryproto\"\n }\n data_param {\n source: \"/home/caffe/examples/zImageDetection/ImageDetection_val_lmdb\"\n batch_size: 50\n backend: LMDB\n }\n}\n
\n\n$ node src/someFile.js\n
\n\n$ node src/firstFile.js\n$ node src/secondFile.js\n$ node src/thirdFile.js\n...\n
\n\n$ node src/*.js\ntf.nn.conv2d_transpose?SoftmaxWithLoss correspond to TensorFlow softmax_cross_entropy_with_logits?tf.nn.conv2_transpose really corresponds to deconvolution layer.tf.image.resize_image_with_crop_or_pad, but this seems to be impossible to use for this purposes, because it can't work with dynamically created tensors nor with 4D tensors that you need to use after tf.nn.conv2_transpose layer.tf.nn.sparse_softmax_cross_entropy_with_logits at the end and it worked for me.
\n\nnumpy_label = np.zeros((614,5),dtype=np.float32)\n\nfor i in range(614):\n numpy_label[i,label_numbers[i]-1] = 1\n\n# Convert to tensor\ny_label_all = tf.convert_to_tensor(numpy_label,dtype=tf.float32)\n
\n\nimages_per_batch = 5\ny_label = tf.placeholder(tf.float32,shape=[images_per_batch,5])\ny_label_all as y_ and want to feed it as y_label:
\n\nfor step in range(100):\n\n # Slice correct labels for current batch\n y_ = tf.slice(y_label_all,[step,0],[images_per_batch,5])\n\n # Train\n _, loss_value = sess.run([train_step,loss],feed_dict={y_label:y_})\n
\n\n_, loss_value = sess.run([train_step,loss],feed_dict={y_label:y_})\n File \"/usr/local/lib/python2.7/dist- packages/tensorflow/python/client/session.py\", line 357, in run\nnp_val = np.array(subfeed_val, dtype=subfeed_t.dtype.as_numpy_dtype)\nValueError: setting an array element with a sequence.\ny_ and y_label:
\n\n#y_: \nTensor(\"Slice:0\", shape=TensorShape([Dimension(5), Dimension(5)]), dtype=float32)\n\n#y_label: \nTensor(\"Placeholder:0\", shape=TensorShape([Dimension(5), Dimension(5)]), dtype=float32)\n
\n\n-client // Contains the front end and AngularJS code \n-server // Contains backend code \n-models // Contains backedn code \n.eslintrc.json files - one in the client folder and one in the ROOT folder.
\n\n{\n \"extends\": \"angular\"\n}\n
\n\n{\n \"extends\": \"airbnb-base\",\n \"root\": true\n}\neslint ., while the backend folders are being linted correctly, the front end doesn't seem to be using the angularjs eslint at all - I am getting errors about ES6 which I am not using the client folder. I don't also get errors about not following John Papa's style guide in the client folder (which the angular plugin should).noreturn and carries_dependency. C++14 added deprecated to the table. However, I cannot find anything clear on what are implementations mandated to do by the standard upon finding an attribute that's unknown to them. Perhaps it's just that the standard doesn't say anything on the matter. Nevertheless, I would like to know.'some_attribute' attribute directive ignored (-Wattributes), while clang complains with unknown attribute 'some_attribute' ignored (-Wunknown-attributes). I haven't been able to find documentation for those options, though; the Warning Options page for GCC merely mentions -Wattributes, while there doesn't even seem to be a similar list for Clang.nonnull attribute. We could happily annotate some functions with it:
\n\n[[gnu::nonnull]] void my_function ( char * a , int * b );\n\n
\n\nvisibility and dllexport without as many #ifs ~yay!#if BUILDING_DLL\n#define DLLEXIMPORT dllexport\n#else\n#define DLLEXIMPORT dllimport\n#endif\n\n// even if MSVC doesn't support specifying dllexport this way, Clang does, and it can\n// compile MSVC-compatible objects\n[[gnu::visibility(\"default\"),DLLEXIMPORT]] void api_function ();\n
\n\n#if SOMETHING\n#define ATTRIBUTE_GNU_NONNULL gnu::nonnull\n#else\n#define ATTRIBUTE_GNU_NONNULL\n#endif\n\n// if ATTRIBUTE_GNU_NONNULL is defined to nothing, all that happens is that we get\n// an empty attribute list, which is 'standardly valid'\n[[ATTRIBUTE_GNU_NONNULL]] void my_function ( char * a , int * b );\n
\n\n#if SOMETHING\n#define ATTRIBUTE_GNU_NONNULL gnu::nonnull\n#else\n#define ATTRIBUTE_GNU_NONNULL\n#endif\n\n#if SOMETHING\n#define ATTRIBUTE_GNU_VISIBILITY( visibility_type ) gnu::visibility(#visibility_type)\n#else\n#define ATTRIBUTE_GNU_VISIBILITY( visibility_type )\n#endif\n\n// if any of the two macros is defined to nothing, it expands to [[,blah_blah]]\n// or [[blah_blah,]] - both of which are invalid\n[[ATTRIBUTE_GNU_NONNULL,ATTRIBUTE_GNU_VISIBILITY(default)]] void my_function\n( char * a , int * b );\n
\n\n#if SOMETHING\n#define ATTRIBUTES_GNU_NONNULL_AND_GNU_VISIBILITY( visibility_type ) \\\n gnu::nonnull,gnu::visibility(#visibility_type)\n#else\n#define ATTRIBUTES_GNU_NONNULL_AND_GNU_VISIBILITY( visibility_type )\n#endif\n\n[[ATTRIBUTES_GNU_NONNULL_AND_GNU_VISIBILITY(default)]] void my_function\n( char * a , int * b );\n:).\n
\n\n
\n\npackage com.hfed.starbuzz;\n\nimport android.content.ContentValues;\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteOpenHelper;\nimport android.util.Log;\n\npublic class StarbuzzDatabaseHelper extends SQLiteOpenHelper {\n\n private static final String DB_NAME = \"starbuzz\";\n private static final int DB_VERSION = 2;\n\n StarbuzzDatabaseHelper(Context context){\n super(context, DB_NAME, null, DB_VERSION);\n }\n\n @Override\n public void onCreate(SQLiteDatabase db){\n updateMyDatabase(db, 0, DB_VERSION);\n }\n\n @Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){\n updateMyDatabase(db, oldVersion, newVersion);\n }\n\n private void updateMyDatabase(SQLiteDatabase db, int oldVersion, int newVersion) {\n if (oldVersion < 1){\n db.execSQL(\"CREATE TABLE DRINK (_id INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT, \"\n + \"DESCRIPTION TEXT, IMAGE_RESOURCE_ID INTEGER);\");\n insertDrink(db, \"Latte\", \"Espresso and steamed milk\", R.drawable.latte);\n insertDrink(db, \"Cappuccino\", \"Espresso, hot milk and steamed-milk foam\", R.drawable.cappuccino);\n insertDrink(db, \"Filter\", \"Our best drip coffee\", R.drawable.filter);\n }\n if(oldVersion < 2){\n db.execSQL(\"ALTER TABLE DRINK ADD COLUMN FAVORITE NUMERIC;\");\n }\n }\n\n private static void insertDrink(SQLiteDatabase db, String name, String description, int resourceID)\n {\n ContentValues drinkValues = new ContentValues();\n drinkValues.put(\"NAME\", name);\n drinkValues.put(\"DESCRIPTION\", description);\n drinkValues.put(\"IMAGE_RESOURCE_ID\", resourceID);\n db.insert(\"DRINK\", null, drinkValues);\n }\n}\n
\n", "Lable": "No"}
{"QuestionId": 36886711, "AnswerCount": 11, "Tags": "package com.hfed.starbuzz;\n\nimport android.app.Activity;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteException;\nimport android.database.sqlite.SQLiteOpenHelper;\nimport android.os.Bundle;\nimport android.content.Intent;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.CursorAdapter;\nimport android.widget.ListView;\nimport android.widget.SimpleCursorAdapter;\nimport android.widget.Toast;\n\npublic class TopLevelActivity extends Activity {\n private SQLiteDatabase db;\n private Cursor favoritesCursor;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_top_level);\n\n AdapterView.OnItemClickListener itemClickListener = new AdapterView.OnItemClickListener(){\n public void onItemClick(AdapterView<?> listView, View v, int position, long id) {\n if(position == 0)\n {\n Intent intent = new Intent(TopLevelActivity.this, DrinkCategoryActivity.class);\n startActivity(intent);\n }\n }\n };\n\n ListView listView = (ListView) findViewById(R.id.list_options);\n listView.setOnItemClickListener(itemClickListener);\n\n ListView listFavorites = (ListView)findViewById(R.id.list_favorites);\n try{\n SQLiteOpenHelper starbuzzDatabaseHelper = new StarbuzzDatabaseHelper(this);\n db =starbuzzDatabaseHelper.getReadableDatabase();\n favoritesCursor = db.query(\"DRINK\", new String[]{\"_id\", \"NAME\"}, \"FAVORITE = 1\", null, null, null, null);\n\n CursorAdapter favoriteAdapter = new SimpleCursorAdapter(TopLevelActivity.this,\n android.R.layout.simple_list_item_1, favoritesCursor, new String[]{\"NAME\"},\n new int[]{android.R.id.text1}, 0);\n listFavorites.setAdapter(favoriteAdapter);\n }catch (SQLiteException e){\n Toast.makeText(this, \"Database unavailable\", Toast.LENGTH_SHORT).show();\n }\n\n listFavorites.setOnItemClickListener(new AdapterView.OnItemClickListener(){\n @Override\n public void onItemClick(AdapterView<?> listView, View v, int position, long id){\n Intent intent = new Intent(TopLevelActivity.this, DrinkActivity.class);\n intent.putExtra(DrinkActivity.EXTRA_DRINKNO, (int) id);\n startActivity(intent);\n }\n });\n }\n\n @Override\n public void onDestroy(){\n super.onDestroy();\n favoritesCursor.close();\n db.close();\n }\n}\n
\n\nfrom keras.models import Sequential\n
\n\nImportError: cannot import name gof\n
\n\nfrom keras.utils.visualize_util import plot\n\nUsing Theano backend.\nUsing gpu device 0: GeForce GTX 970M (CNMeM is disabled, cuDNN not available)\nTraceback (most recent call last):\n\n File \"<ipython-input-1-65016ddab3cd>\", line 1, in <module>\n from keras.utils.visualize_util import plot\n\n File \"C:\\Anaconda2\\lib\\site-packages\\keras\\utils\\visualize_util.py\", line 8, in <module>\n raise RuntimeError('Failed to import pydot. You must install pydot'\n\nRuntimeError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.\npip install graphviz and pip install git+https://github.com/nlhepler/pydot.git
\n\n[HttpPost]\n public JsonResult AddClient(Models.Client client)\n { \n var cli = new Models.Client();\n cli.name = client.name;\n cli.npi = client.npi;\n cli.dateAdded = DateTime.Now.ToShortDateString();\n return Json(cli);\n }\n
\r\nexport interface Client {\r\n name: string;\r\n npi: number;\r\n dateAdded?: string;\r\n id?: number\r\n}
Here's my Angular2 service:
\n\nimport {Injectable} from 'angular2/core';\r\nimport {Client} from './client';\r\nimport {RequestOptions, Http, Response, Headers, URLSearchParams} from 'angular2/http';\r\nimport {Observable} from 'rxjs/Observable';\r\n\r\n\r\n@Injectable()\r\nexport class ClientService {\r\n constructor(private http: Http) { }\r\n\r\n\r\n getClients(): Observable<Client[]> {\r\n return this.http.get('/Client/GetClients')\r\n .map(this.extractData);\r\n }\r\n\r\n addClient(client: Client): Observable<Client> {\r\n let clientUrl = '/Client/AddClient';\r\n let body = JSON.stringify({ client });\r\n let header = new Headers({ 'Content-Type': 'application/json' });\r\n let options = new RequestOptions({ headers: header });\r\n\r\n return this.http.post(clientUrl, body, options)\r\n .map(this.extractData)\r\n .catch(this.handleError);\r\n }\r\n\r\n private extractData(res: Response) {\r\n if (res.status < 200 || res.status >= 300) {\r\n throw new Error('Bad response status: ' + res.status);\r\n }\r\n let body = res.json();\r\n return body || {};\r\n }\r\n private handleError(error: any) {\r\n // In a real world app, we might send the error to remote logging infrastructure\r\n let errMsg = error.message || 'Server error';\r\n console.error(errMsg); // log to console instead\r\n return Observable.throw(errMsg);\r\n }\r\n}\r\nThanks for any help!
\n", "Lable": "No"} {"QuestionId": 36916690, "AnswerCount": 6, "Tags": "While working on Udacity Deep Learning assignments, I encountered memory problem. I need to switch to a cloud platform. I worked with AWS EC2 before but now I would like to try Google Cloud Platform (GCP). I will need at least 8GB memory. I know how to use docker locally but never tried it on the cloud.
\n\nThis is my log
\n\nLog file created at: 2016/04/29 14:01:52\n Running on machine: DELL\n Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\n F0429 14:01:52.191473 14832 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: examples/hdf5_classification/nonlinear_auto_train.prototxt\n\n\nThis is my bat
\n\n.\\bin\\caffe.exe train --solver=D:\\caffe-windows-master\\examples\\hdf5_classification\\nonlinear_solver.prototxt\npause\n\n\nThis is my nonlinear_solver.prototxt
\n\ntrain_net: \"examples/hdf5_classification/nonlinear_auto_train.prototxt\"\n#test_net: \"examples/hdf5_classification/nonlinear_auto_test.prototxt\"\n#test_iter: 250\n#test_interval: 1000\nbase_lr: 0.01\nlr_policy: \"step\"\ngamma: 0.1\nstepsize: 5000\ndisplay: 1000\nmax_iter: 10000\nmomentum: 0.9\nweight_decay: 0.0005\nsnapshot: 10000\nsnapshot_prefix: \"examples/hdf5_classification/data/train\"\nsolver_mode: GPU\n\n\nThis is my nonlinear_auto_train.prototxt
\n\nlayer {\n name: \"data\"\n type: \"HDF5Data\"\n top: \"data\"\n top: \"label\"\n hdf5_data_param {\n source: \"D:\\caffe-windows-master\\examples/hdf5_classification/data/list.txt\"\n batch_size: 10\n }\n}\nlayer {\n name: \"ip1\"\n type: \"InnerProduct\"\n bottom: \"data\"\n top: \"ip1\"\n inner_product_param {\n num_output: 40\n weight_filler {\n type: \"xavier\"\n }\n }\n}\nlayer {\n name: \"relu1\"\n type: \"ReLU\"\n bottom: \"ip1\"\n top: \"ip1\"\n}\nlayer {\n name: \"ip2\"\n type: \"InnerProduct\"\n bottom: \"ip1\"\n top: \"ip2\"\n inner_product_param {\n num_output: 2\n weight_filler {\n type: \"xavier\"\n }\n }\n}\nlayer {\n name: \"accuracy\"\n type: \"Accuracy\"\n bottom: \"ip2\"\n bottom: \"label\"\n top: \"accuracy\"\n}\nlayer {\n name: \"loss\"\n type: \"SoftmaxWithLoss\"\n bottom: \"ip2\"\n bottom: \"label\"\n top: \"loss\"\n}\n\n\nthe code runs on the windows
\n\n\n\n\nFirstly, I can't find the D:\\ThirdPartyLibrary;
\n \nSecondly, the h5 file has been saved in proper folder;
\n \nThirdly, I use the absolute path for every file
\n
I don't know why the code doesn't run well
\n", "Lable": "D"} {"QuestionId": 36994890, "AnswerCount": 0, "Tags": "So I have some 32x32 images with 3 color channels so I flattened them out and made their shape 3072. I loaded the images and reshaped them to be a (1, 3072) numpy matrix but when the network is running it will give the following error:
\n\nTraceback (most recent call last):\n File \"/Users/Me/project/lib/python3.4/site-packages/tensorflow/python/client/session.py\", line 428, in _do_run\ntarget_list)\ntensorflow.python.pywrap_tensorflow.StatusNotOK: Invalid argument: Incompatible shapes: [300] vs. [100] \n[[Node: Equal_1 = Equal[T=DT_INT64, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](ArgMax_2, ArgMax_3)]]\n\n\nThis is the code that loads the images:
\n\nname = QtGui.QFileDialog.getOpenFileNames(self, 'Open File')\nfname = [str(each) for each in name]\nflist = []\ndlist = []\nfor n, val in enumerate(name):\n flist.append(val)\n img = Image.open(flist[n])\n img.load()\n data = np.asarray(img, dtype = \"int32\")\n print(data.shape)\n data.shape = (1, 3072)\n quack = np.asmatrix(data)\n print(quack)\n dlist.append(quack)\nprint(dlist)\nfor n in range(len(dlist)):\n if n==0:\n self.inlist = dlist[n]\n if n>0:\n self.inlist = np.vstack((self.inlist, dlist[n]))\n\n\nI am doing it in batches of 100.\nThe error seems to be coming from the following lines:
\n\nfor i in range(2000):\n if i%100 == 0:\n train_accuracy = accuracy.eval(feed_dict={\n x:self.inlist, y_: self.outListm, keep_prob: 1.0})\n print (\"step %d, training accuracy %g\"%(i, train_accuracy))\n self.progress.setValue(i/199.99)\n train_step.run(feed_dict={x: self.inlist, y_: self.outListm, keep_prob: 0.5}) \n\n\nThis is the code of the network that I got from the Tensorflow website and changed a little.
\n\nW_conv1 = weight_variable([1, 2, 1, 32])\nb_conv1 = bias_variable([32])\n\nx_image = tf.reshape(x, [-1,32,32,1])\n\nh_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)\nh_pool1 = max_pool_2x2(h_conv1)\n\nW_conv2 = weight_variable([1, 2, 32, 64])\nb_conv2 = bias_variable([64])\n\nh_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)\nh_pool2 = max_pool_2x2(h_conv2)\n\nW_fc1 = weight_variable([8 * 8 * 64, 1024])\nb_fc1 = bias_variable([1024])\n\nh_pool2_flat = tf.reshape(h_pool2, [-1, 8*8*64])\n\nkeep_prob = tf.placeholder(\"float\")\nh_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)\n\nW_fc2 = weight_variable([1024, 512])\nb_fc2 = bias_variable([512])\n\ny_conv=tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)\n\ncross_entropy = -tf.reduce_sum(y_*tf.log(y_conv))\ntrain_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)\ncorrect_prediction = tf.equal(tf.argmax(y_conv,1), tf.argmax(y_,1))\naccuracy = tf.reduce_mean(tf.cast(correct_prediction, \"float\"))\nsess.run(tf.initialize_all_variables())\nfor i in range(2000):\n if i%100 == 0:\n train_accuracy = accuracy.eval(feed_dict={x: self.inlist, y_: self.outListm, keep_prob: 1.0})\n print (\"step %d, training accuracy %g\"%(i, train_accuracy))\n self.progress.setValue(i/199.99)\n train_step.run(feed_dict={x: self.inlist, y_: self.outListm, keep_prob: 0.5})\n\n", "Lable": "D"}
{"QuestionId": 37007495, "AnswerCount": 3, "Tags": "I am having trouble when installing Caffe Deep Learning Framework on Python:
\n\nWhen I run make command at caffe directory, it says
\n\n\nhdf5.h:no such directory
\n
The steps I have done:
\n\nUpdate and upgrade my Ubuntu Server
Install Python 2.7
Having all of the dependencies base on http://caffe.berkeleyvision.org/install_apt.html
Run cp cp Makefile.config.example Makefile.config
Uncomment cpu_only = 1 in Makefile.config
I will be grateful if someone can help me.
\n\nError message:
\n\nCXX src/caffe/util/hdf5.cpp\nin file include from src/caffe/util/hdf5.cpp:1:0:\n./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory\ncompilation terminated \n\nMakefile:572 recipe for target '.build_release/src/caffe/util/hdf5.o' \nfailed Make:*** [.build_release/src/caffe/util/hdf5.o] Error 1\n\n", "Lable": "D"}
{"QuestionId": 37109166, "AnswerCount": 1, "Tags": "I am getting the following error when executing the code below. rnn.rnn() returns a list of tensors. Error is on the convert_to_tensor line.
\n\n\n\n\nTypeError: List of Tensors when single Tensor expected
\n
outputs, _states = rnn.rnn(lstm, X_split, initial_state=init_state)\noutput_tensor = tf.convert_to_tensor(outputs)\n\n\nWhen I also initialized the dtype argument to tf.float32
\n\noutput_tensor = tf.convert_to_tensor(outputs, dtype=tf.float32)\n\n\nI got the following error on the same line:
\n\n\n\n\nTypeError: Expected float32, got list containing Tensors of type '_Message' instead.
\n
What is the cause of these errors? I want my final output to be a tensor containing tensors.
\n\nEDIT: I checked the DType of the individual tensors of the list. All of them are of type float32. What could be the cause of this error now?
\n", "Lable": "D"} {"QuestionId": 37244708, "AnswerCount": 1, "Tags": "I'm trying to work through the Tensorflow tutorials and have gotten stuck trying to enhance the RNN/language model tutorial so that I can predict the next word in a sentence. The tutorial uses word embeddings as the representation for the words.
\n\nSince the model learns on the word embeddings, I'm assuming that any sort of prediction I add will output the same embeddings. What I can't figure out is how to convert from those embeddings back to the word ids from the dataset. The only example I have seen kept an in memory data structure with the reverse of the mapping of wordid -> embedding and used that for lookups. This obviously won't work for all problems. Is there a better way?
\n", "Lable": "D"}