compare_oracle / oraclechunk48.json
xPXXX's picture
Upload 10 files
26d7090
Raw
History Blame Contribute Delete
38 kB
Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
{"QuestionId": 35017213, "AnswerCount": 0, "Tags": "<python><opencv><neural-network><deep-learning><caffe>", "CreationDate": "2016-01-26T15:15:50.777", "AcceptedAnswerId": null, "Title": "why net.blobs['fc7'].data[0] giving all zeros", "Body": "<p>I want to extract face descriptors from photos of people. This is what I've done so far:</p>\n\n<ol>\n<li>First detected faces from photos using opencv library in python.</li>\n<li>Saved those faces in another image.</li>\n<li>Next I have to extract descriptor from face image.</li>\n</ol>\n\n<p>For this I have downloaded <code>vgg face caffemodel</code> CNN from here: <a href=\"http://www.robots.ox.ac.uk/~vgg/software/vgg_face/\" rel=\"nofollow\">http://www.robots.ox.ac.uk/~vgg/software/vgg_face/</a></p>\n\n<p>To extract descriptor, first I did this:</p>\n\n<pre><code> net = caffe.Net('CAFFE_FACE_deploy.prototxt','CAFFE_FACE.caffemodel',caffe.TEST)\n img = caffe.io.load_image( \"detectedface.jpg\" )\n img = img[:,:,::-1]*255.0 \n avg = np.array([129.1863,104.7624,93.5940])\n img = img - avg \n img = img.transpose((2,0,1)) \n img = img[None,:]\n out = net.forward_all( data = img )\n</code></pre>\n\n<p>But it gives dimension mismatch error that data should be of dimension <code>(50,3,224,224)</code> instead of <code>(50,3,490,490)</code></p>\n\n<p>Then I tried this:</p>\n\n<pre><code> # input preprocessing: 'data' is the name of the input blob == net.inputs[0]\n transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})\n transformer.set_transpose('data', (2,0,1))\n transformer.set_mean('data', np.load(caffe_root + 'python/caffe/imagenet/ilsvrc_2012_mean.npy').mean(1).mean(1)) # mean pixel\n transformer.set_raw_scale('data', 255) # the reference model operates on images in [0,255] range instead of [0,1]\n transformer.set_channel_swap('data', (2,1,0)) # the reference model has channels in BGR order instead of RGB\n\n net.blobs['data'].reshape(50,3,224,224)\n\n net.blobs['data'].data[...] = transformer.preprocess('data', caffe.io.load_image('detectedface.jpg'))\n out = net.forward()\n\n feats = net.blobs['fc7'].data[0]\n</code></pre>\n\n<p>Here when I <code>print feats</code>, it displays all zeros. Why is it so?</p>\n", "Lable": "D"}
{"QuestionId": 35078304, "AnswerCount": 2, "Tags": "<maven><jar><proxy><sonarqube>", "CreationDate": "2016-01-29T06:36:12.713", "AcceptedAnswerId": null, "Title": "sonar-maven-plugin wont download jars behind proxy", "Body": "<p>I have the following in my pom.xml to enable the sonar plugin:</p>\n\n<pre><code>&lt;plugin&gt;\n &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;\n &lt;artifactId&gt;sonar-maven-plugin&lt;/artifactId&gt;\n &lt;version&gt;2.7.1&lt;/version&gt;\n&lt;/plugin&gt;\n</code></pre>\n\n<p>I also have set the property to define my server which runs on port 80:</p>\n\n<pre><code>&lt;properties&gt;\n &lt;sonar.host.url&gt;http://sonar.for.truelocal.com.au/&lt;/sonar.host.url&gt;\n&lt;/properties&gt;\n</code></pre>\n\n<p>When running this from my Bamboo server, all is well and analysis is sent to the server.</p>\n\n<p>I then wanted to run a preview report in my local environment. My local environment is a Mac 10.11.2 with Java 7 behind a proxy server.</p>\n\n<p>I added some extra properties to my dev Maven profile:</p>\n\n<pre><code>&lt;sonar.analysis.mode&gt;preview&lt;/sonar.analysis.mode&gt;\n&lt;sonar.issuesReport.console.enable&gt;true&lt;/sonar.issuesReport.console.enable&gt;\n&lt;sonar.issuesReport.html.enable&gt;true&lt;/sonar.issuesReport.html.enable&gt;\n</code></pre>\n\n<p>Unfortunately the sonar step fails with the following:</p>\n\n<pre><code>[DEBUG] Create : /Users/w26702/.sonar/cache/_tmp\n[DEBUG] Extract sonar-runner-batch in temp...\n[DEBUG] Get bootstrap index...\n[DEBUG] Download: http://sonar.for.truelocal.com.au/batch_bootstrap/index\n[DEBUG] Get bootstrap completed\n[DEBUG] Download http://sonar.for.truelocal.com.au/batch/sonar-batch-shaded-5.2.jar to /Users/w26702/.sonar/cache/_tmp/fileCache3157929989449184462.tmp\n[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default) on project truelocal-api: Fail to download libraries from server: Fail to download sonar-batch-shaded-5.2.jar to /Users/w26702/.sonar/cache/_tmp/fileCache3157929989449184462.tmp: timeout: Read timed out -&gt; [Help 1]\n</code></pre>\n\n<p>Note that last line is specifies a different plugin to what I quoted above in my pom. This is because after org.codehaus.mojo 2.7.1 didn't work I switched to org.sonarsource.scanner.maven 3.0.1 but it did not make any difference.</p>\n\n<p>I logged on to my sonarqube server and tailed by access log while i was running the build and I actually see the requests for /batch_bootstrap/index and /batch/sonar-batch-shaded-5.2.jar with HTTP 200 OKs.</p>\n\n<p>It seems that the index is received back but the .jar is not.</p>\n\n<p>I then just manually browsed the jar address in my web browser and it is downloaded correctly.</p>\n\n<p>I then disconnected from the corporate network and instead tethered to my phone which has no proxy.</p>\n\n<p>When running like this, the jars are downloaded and the analysis runs without issue.</p>\n\n<p>When I put my machine back behind the proxy, the analysis continues to run without issue because the jars have now been successfully downloaded.</p>\n\n<p>So my question is, is there a bug with the plugin downloading the jars when behind a proxy?</p>\n\n<p>I can't rule out the possibility of my corporate network causing the issue but other jars including the sonar-maven-plugin jar itself do not have issues.</p>\n\n<p>My Sonarqube server version is 5.1-1 on Amazon Linux with a PostgreSQL backend.</p>\n", "Lable": "No"}
{"QuestionId": 35151704, "AnswerCount": 0, "Tags": "<javascript><angularjs><angularjs-directive>", "CreationDate": "2016-02-02T11:04:45.267", "AcceptedAnswerId": null, "Title": "unsave change angularjs not working in ngDialog?", "Body": "<p><a href=\"http://plnkr.co/edit/LF6Vnd68eVNhCKKFCsLn?p=preview\" rel=\"nofollow\">Here discard &amp; redirected using alert-- working </a></p>\n\n<p><a href=\"http://plnkr.co/edit/ixawvayY9TapmQpWK3ht?p=preview\" rel=\"nofollow\">Here discard &amp; redirect exdialog - not working </a></p>\n\n<pre><code>Link 1 : \n</code></pre>\n\n<p>CheckStateChangeService allow to navigate if any changes on form asking confirmation alert using confirm message -- working fine </p>\n\n<pre><code>Link 2 : \n</code></pre>\n\n<p>CheckStateChangeService allow to navigate if any changes on form asking ngexdialog box , its working but not redirect to another page </p>\n", "Lable": "No"}
{"QuestionId": 35214459, "AnswerCount": 3, "Tags": "<c#><serialization><asp.net-web-api><asp.net-web-api2>", "CreationDate": "2016-02-05T00:45:53.237", "AcceptedAnswerId": "35214558", "Title": "Web API - error when returning list of complex objects", "Body": "<p>I have created a webAPI controller method that looks the following:</p>\n\n<pre><code> [HttpGet]\n public HttpResponseMessage RealEstates()\n {\n using (BoligsideDbContext context = new BoligsideDbContext())\n {\n List&lt;RealEstateVm&gt; realEstateVms = context.RealEstates.OrderByDescending(x =&gt; x.Id).ToList().Select(x =&gt; new RealEstateVm(x)).ToList();\n\n return Request.CreateResponse(HttpStatusCode.OK, realEstateVms);\n }\n}\n</code></pre>\n\n<p>My VM looks the following:</p>\n\n<pre><code>public class RealEstateVm\n {\n public int Id { get; set; }\n public string Title { get; set; }\n public string Description { get; set; }\n public int Area { get; set; }\n public int Rooms { get; set; }\n public int Rent { get; set; }\n public string Picture { get; set; }\n public RealEstateType Type { get; set; } //this is just an enum\n public string Address { get; set; }\n public List&lt;string&gt; Images { get; set; }\n public string Name { get; set; }\n public string Email { get; set; }\n public string Phone { get; set; }\n public string Phone2 { get; set; }\n public string OriginalUrl { get; set; }\n public string OriginalSource { get; set; }\n public string City { get; set; }\n public int ZipCode { get; set; }\n public string StreetAddress { get; set; }\n public double Longtitude { get; set; }\n public double Latitude { get; set; }\n}\n</code></pre>\n\n<p>However whenever I go to the endpoint I get the following error:</p>\n\n<blockquote>\n <p>Type 'Boligside.ViewModels.RealEstateVm' cannot be serialized.\n Consider marking it with the DataContractAttribute attribute, and\n marking all of its members you want serialized with the\n DataMemberAttribute attribute. If the type is a collection, consider\n marking it with the CollectionDataContractAttribute. See the Microsoft\n .NET Framework documentation for other supported types.</p>\n</blockquote>\n\n<p>What could be the issue? I don't see why I should have to mark my VM with [DataContractAttribute]?</p>\n\n<p>By the way the complete error message is here:</p>\n\n<blockquote>\n <p>This XML file does not appear to have any style information associated\n with it. The document tree is shown below. An error\n has occurred. The 'ObjectContent`1' type\n failed to serialize the response body for content type\n 'application/xml; charset=utf-8'. \n System.InvalidOperationException\n An error has\n occurred. Type\n 'Boligside.ViewModels.RealEstateVm' cannot be serialized. Consider\n marking it with the DataContractAttribute attribute, and marking all\n of its members you want serialized with the DataMemberAttribute\n attribute. If the type is a collection, consider marking it with the\n CollectionDataContractAttribute. See the Microsoft .NET Framework\n documentation for other supported types. \n \n System.Runtime.Serialization.InvalidDataContractException\n at\n System.Runtime.Serialization.DataContract.DataContractCriticalHelper.ThrowInvalidDataContractException(String\n message, Type type) at\n System.Runtime.Serialization.DataContract.DataContractCriticalHelper.CreateDataContract(Int32\n id, RuntimeTypeHandle typeHandle, Type type) at\n System.Runtime.Serialization.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation(Int32\n id, RuntimeTypeHandle typeHandle, Type type) at\n System.Runtime.Serialization.XmlObjectSerializerContext.GetDataContract(Int32\n id, RuntimeTypeHandle typeHandle) at\n System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator\n xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType,\n Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle) at\n WriteArrayOfRealEstateVmToXml(XmlWriterDelegator , Object ,\n XmlObjectSerializerWriteContext , CollectionDataContract ) at\n System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator\n xmlWriter, Object obj, XmlObjectSerializerWriteContext context) at\n System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract\n dataContract, XmlWriterDelegator xmlWriter, Object obj,\n RuntimeTypeHandle declaredTypeHandle) at\n System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract\n dataContract, XmlWriterDelegator xmlWriter, Object obj,\n RuntimeTypeHandle declaredTypeHandle) at\n System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator\n writer, Object graph, DataContractResolver dataContractResolver) at\n System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator\n writer, Object graph, DataContractResolver dataContractResolver) at\n System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator\n writer, Object graph, DataContractResolver dataContractResolver) at\n System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter\n writer, Object graph) at\n System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStream(Type\n type, Object value, Stream writeStream, HttpContent content) at\n System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStreamAsync(Type\n type, Object value, Stream writeStream, HttpContent content,\n TransportContext transportContext, CancellationToken\n cancellationToken) --- End of stack trace from previous location where\n exception was thrown --- at\n System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task\n task) at\n System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task\n task) at\n System.Web.Http.WebHost.HttpControllerHandler.d__1b.MoveNext()\n </p>\n</blockquote>\n", "Lable": "No"}
{"QuestionId": 35225627, "AnswerCount": 1, "Tags": "<javascript><jquery><ajax><multiplying>", "CreationDate": "2016-02-05T13:39:34.377", "AcceptedAnswerId": null, "Title": "How To use js variable into another file", "Body": "<p>I have a Javascript variable that has some value on-change. Now i want to use this variable in another file for some calculation.</p>\n\n<p>For example i have my variable in index.php as follow:</p>\n\n<pre><code> $(function() {\n $(\"#sel\").on(\"change\", function() {\n var vall = $(this).find('option:selected').attr('value')\n alert(vall);\n });\n });\n</code></pre>\n\n<p>And in another file calculate.php i have code like this and want to use \"vall\" variable to multiple with \"$total variable\"</p>\n\n<pre><code>public function getGrandTotal(){\n $quote = Mage::getModel('checkout/session')-&gt;getQuote();\n $total = $quote-&gt;getGrandTotal();\n $gt = $total * var vall ; // \"vall\" variable to multiply with total\n\n return Mage::helper('checkout')-&gt;formatPrice($gt);\n}\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 35306476, "AnswerCount": 1, "Tags": "<f#><f#-data>", "CreationDate": "2016-02-10T03:49:22.893", "AcceptedAnswerId": "35314116", "Title": "CsvProvider type not defined", "Body": "<p>I'm attempting to use CsvProvider for f# but it says the type isn't defined even though I'm importing FSharp.Data.</p>\n\n<pre><code>open FSharp.Data\n\ntype test = CsvProvider&lt;\"C:\\\\First_Names.csv\"&gt;\n</code></pre>\n\n<p>I'm not using the interactive scripts. This is an .fs file. It doesn't tell me that FSharp.Data can't be found. It was even in the intellisense.</p>\n\n<p>What are some ways I can diagnose this problem, because I'm at a loss now.</p>\n", "Lable": "No"}
{"QuestionId": 35321081, "AnswerCount": 1, "Tags": "<android-studio><android-animation>", "CreationDate": "2016-02-10T16:46:54.160", "AcceptedAnswerId": "35367292", "Title": "Rorating gear animation in android studio", "Body": "<p>I am new in android and I am using android studio</p>\n\n<p>Here is the image.\ni want to rotate gears inside this image.\nHow can i do this? \nPlease anybody suggest solution.\n<a href=\"http://i.stack.imgur.com/mrUem.jpg\" rel=\"nofollow\">Rotate all three gear</a></p>\n", "Lable": "No"}
{"QuestionId": 35333007, "AnswerCount": 3, "Tags": "<ruby-on-rails><ruby>", "CreationDate": "2016-02-11T07:17:07.083", "AcceptedAnswerId": "35333303", "Title": "action create couldn't be found for PostsController", "Body": "<p>I'm following a rails tutorial and need some help to proceed further. Problem is, once I fill out the form which has a title,body fields and hit submit, it has to redirect to the show.html.erb page instead it throws an error.</p>\n\n<p><strong>Error:</strong> The action 'create' could not be found for PostsController</p>\n\n<p><strong>routes.rb</strong> </p>\n\n<pre><code>Rails.application.routes.draw do\n\n get \"/pages/about\" =&gt; \"pages#about\"\n get \"/pages/contact\" =&gt; \"pages#contact\"\n\n get \"/posts\" =&gt; \"posts#index\"\n post \"/posts\" =&gt; \"posts#create\"\n\n get \"/posts/show\" =&gt; \"posts#show\", as: :show\n get \"/posts/new\" =&gt; \"posts#new\"\n\n\nend\n</code></pre>\n\n<p><strong>posts_controller_tests.rb</strong></p>\n\n<pre><code>require 'test_helper'\n\nclass PostsControllerTest &lt; ActionController::TestCase\n def index\n\n end\n\n def new\n @post = Post.new\n end\n\n def create\n @post = Post.new(post_params)\n @post.save\n redirect_to show_path\n end\n\n def show\n\n end\n\n private \n\n def post_params\n params.require(:post).permit(:title, :body)\n end\nend\n</code></pre>\n\n<p><strong>new.html.erb</strong> </p>\n\n<pre><code>&lt;h1&gt;Create a new blog post&lt;/h1&gt;\n\n&lt;div class=\"form\"&gt;\n\n&lt;%= form_for Post.new do |f| %&gt;\n &lt;%= f.label :title %&gt;: &lt;br&gt;\n &lt;%= f.text_field :title %&gt; &lt;br&gt; &lt;br&gt;\n\n &lt;%= f.label :body %&gt;: &lt;br&gt;\n &lt;%= f.text_area :body %&gt; &lt;br&gt; &lt;br&gt;\n\n &lt;%= f.submit %&gt;\n\n&lt;% end %&gt;\n\n&lt;/div&gt;\n</code></pre>\n\n<p>Any help on this would be appreciated. </p>\n", "Lable": "No"}
{"QuestionId": 35407651, "AnswerCount": 4, "Tags": "<php><html><ini>", "CreationDate": "2016-02-15T11:02:02.023", "AcceptedAnswerId": "35407747", "Title": "How to open file from php code inside html file", "Body": "<p>I have \".html\" file and inside it I run php code. The php code should open \".ini\" file.</p>\n\n<pre><code>\".ini\" file:\nblast+: blast+\\bin\n\nblastn: test_na_db =&gt; Nucleotide test database\nblastp: test_aa_db =&gt; Protein test database\nblastx: test_aa_db =&gt; Protein test database\ntblastn: test_na_db =&gt; Nucleotide test database\ntblastx: test_na_db =&gt; Nucleotide test database\n\n\n\".html\" file:\n&lt;td valign=top&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Database(s)&lt;/td&gt;\n&lt;td&gt;\n&lt;?php\n$fp = fopen (\"./filename.ini\", \"r\");\nif(!$fp) {\n echo \"&lt;p&gt;&lt;strong&gt; Error: Couldn't open file filename.ini &lt;/strong&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;\";\n exit;\n}\nwhile(!feof($fp)) {\n $blastdbstring = rtrim(fgets($fp));\n if (!$blastdbstring) {\n continue;\n }\n if (!preg_match(\"/^\\s*#/\", $blastdbstring)) {\n $blastdbArray = preg_split('/:/', $blastdbstring); \n $blastProgram = $blastdbArray[0];\n $dbString = $blastdbArray[1];\n\n if ($blastProgram == \"blast+\") {\n echo \"&lt;input type='hidden' name= 'blastpath' value='$dbString'&gt;\";\n }else {\n if (preg_match(\"/^\\s*(.*?)\\s*$/\", $blastProgram, $match)) {\n $blastProgram = $match[1];\n }\n if (preg_match(\"/^\\s*(.*?)(\\s*|\\s*,\\s*)$/\", $dbString, $match)) {\n $dbString = $match[1];\n }\n $dbString = preg_replace(\"/\\s*=&gt;\\s*/\", \"=&gt;\", $dbString);\n if (preg_match(\"/,/\", $dbString, $match)) {\n $dbString = preg_replace(\"/\\s*,\\s*/\", \",\", $dbString);\n } \n echo \"&lt;input id='$blastProgram' type='hidden' name='blastdb[]' value='$dbString'&gt;\";\n }\n } \n}\nfclose($fp);\n\n?&gt;\n&lt;select id=\"dbList\" size=4 multiple=\"multiple\" name =\"patientIDarray[]\"&gt;\n&lt;script type=\"text/javascript\"&gt;\n here call js function that create options depend on the selection of previous question\n&lt;/script&gt;\n\n&lt;/select&gt;\n&lt;/td&gt;\n</code></pre>\n\n<p>Each time I got this error message: \nCouldn't open file filename.ini!!!!</p>\n\n<p>\".html\" file and \".ini\" file are in the same directory.</p>\n\n<p>I have full control on that \".ini\" file</p>\n\n<p>Any suggestions?</p>\n", "Lable": "No"}
{"QuestionId": 35481805, "AnswerCount": 1, "Tags": "<c++><opencv><caffe>", "CreationDate": "2016-02-18T12:42:35.317", "AcceptedAnswerId": null, "Title": "Using Caffe memory layer does NOT produce consistent and deterministic results", "Body": "<p>I am using the Caffe framework for windows (downloaded from <a href=\"https://github.com/happynear/caffe-windows\" rel=\"nofollow\">here</a>) on a Windows 7 64-bit machine. I am using C++ within Visual Studio Community 2013. I use the pre-trained GoogLeNet model to extract the loss1-fc layer output to use as a feature vector for each image. So far so good.</p>\n\n<p>Recently i tried changing my software for use with video frames. So i changed the first layer from an ImageData layer to a Memory layer, so i can send to Caffe a vector of OpenCV mats instead of the naive approach of writing each frame to disk and sending a file list to caffe.</p>\n\n<p>Now, i noticed i won't get the same results for the same images! When using the ImageData layer, there's no such thing. </p>\n\n<p>I use CPU (no Cudnn, no GPU).</p>\n\n<p>The function i use for feature extraction is the following:</p>\n\n<pre><code>void feature_extraction_pipeline_memory(boost::shared_ptr&lt;Net&lt;Dtype&gt;&gt; feature_extraction_net, vector&lt;cv::Mat&gt; imgs, vector&lt;int&gt; labels, float** blobFeats, vector&lt;string&gt; blob_names){\n\n boost::dynamic_pointer_cast&lt;caffe::MemoryDataLayer&lt;float&gt;&gt;(feature_extraction_net-&gt;layers()[0])-&gt;AddMatVector(imgs, labels);\n\n size_t num_mini_batches = imgs.size();\n size_t num_features = blob_names.size();\n int dim_features;\n int batch_size;\n vector&lt;Blob&lt;float&gt;*&gt; input_vec;\n vector&lt;int&gt; image_indices(num_features, 0);\n\n for (size_t batch_index = 0; batch_index &lt; num_mini_batches; ++batch_index) {\n feature_extraction_net-&gt;Forward(input_vec);\n for (size_t i = 0; i &lt; num_features; ++i) {\n const boost::shared_ptr&lt;Blob&lt;Dtype&gt;&gt; feature_blob = feature_extraction_net-&gt;blob_by_name(blob_names[i]);\n batch_size = feature_blob-&gt;num();\n dim_features = feature_blob-&gt;count() / batch_size;\n const Dtype* feature_blob_data;\n for (size_t n = 0; n &lt; batch_size; ++n) {\n feature_blob_data = feature_blob-&gt;cpu_data() + feature_blob-&gt;offset(n);\n for (size_t d = 0; d &lt; dim_features; ++d)\n blobFeats[i][(image_indices[i] * dim_features) + d] = feature_blob_data[d];\n\n ++image_indices[i];\n } // n &lt; batch_size\n } // i &lt; num_features\n } // batch_index &lt; num_mini_batches\n}\n</code></pre>\n\n<p>The <code>imgs</code> vector is a vector of mat. The <code>labels</code> is a vector of int, all set to 0. I wrote all images to disk again once they were added to vector. I checked and there is no problem with that. So there is nothing wrong when loading the images. By the way i use OpenCV 3.1.</p>\n\n<p>The memory layer in GoogLeNet prototxt file is declared as follows:</p>\n\n<pre><code>layer {\n name: \"data\"\n type: \"MemoryData\"\n top: \"data\"\n top: \"label\"\n memory_data_param {\n batch_size: 1\n channels: 3\n height: 227\n width: 227\n }\n transform_param {\n crop_size: 227\n mirror: true\n mean_file: \"model_googlenet_mem/imagenet_mean.binaryproto\"\n }\n include: { phase: TEST }\n}\n</code></pre>\n\n<p>and is the first layer.</p>\n\n<p>I print the first 10 values for each image. Note that images 0, 1, 2, 3 are the EXACT same file copied and the same holds for 6, 7 and 8 images.</p>\n\n<pre><code>1st run:\n0.jpg :: 3.149, 0.000, 0.000, 0.000, 1.586, 0.000, 0.000, 0.755, 0.000, 4.749,\n1.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n2.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n3.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n4.jpg :: 3.957, 0.000, 0.000, 0.000, 0.868, 0.000, 0.000, 0.000, 0.000, 6.396,\n5.jpg :: 3.179, 0.000, 0.000, 0.000, 0.906, 0.000, 0.000, 0.000, 0.000, 5.508,\n6.jpg :: 4.951, 0.000, 0.000, 0.000, 0.000, 0.343, 2.993, 0.000, 0.000, 0.000,\n7.jpg :: 4.567, 0.000, 0.000, 0.000, 0.000, 1.251, 2.446, 0.000, 0.000, 0.000,\n8.jpg :: 4.951, 0.000, 0.000, 0.000, 0.000, 0.343, 2.993, 0.000, 0.000, 0.000,\n9.jpg :: 5.678, 0.000, 0.000, 2.010, 0.000, 1.064, 2.412, 0.000, 0.000, 0.000,\n</code></pre>\n\n<p>2nd run:</p>\n\n<pre><code>0.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n1.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n2.jpg :: 3.149, 0.000, 0.000, 0.000, 1.586, 0.000, 0.000, 0.755, 0.000, 4.749,\n3.jpg :: 2.680, 0.000, 0.000, 0.560, 0.970, 0.000, 0.000, 1.083, 0.000, 4.420,\n4.jpg :: 3.957, 0.000, 0.000, 0.000, 0.868, 0.000, 0.000, 0.000, 0.000, 6.396,\n5.jpg :: 2.928, 0.000, 0.000, 0.000, 0.769, 0.000, 0.000, 0.000, 0.000, 5.552,\n6.jpg :: 4.567, 0.000, 0.000, 0.000, 0.000, 1.251, 2.446, 0.000, 0.000, 0.000,\n7.jpg :: 4.567, 0.000, 0.000, 0.000, 0.000, 1.251, 2.446, 0.000, 0.000, 0.000,\n8.jpg :: 4.951, 0.000, 0.000, 0.000, 0.000, 0.343, 2.993, 0.000, 0.000, 0.000,\n9.jpg :: 5.678, 0.000, 0.000, 2.010, 0.000, 1.064, 2.412, 0.000, 0.000, 0.000,\n</code></pre>\n\n<p>The layers output is different for the same images and different for different runs! When using the same procedure with the ImageData layer there is no such problem. Also, the problem holds for the output of other layers too, for example loss3/classifier. So, i suspect there might be a bug within the MemoryLayer implementation.</p>\n\n<p>Has anyone noticed this strange behaviour? I read that cudnn might produce non-deterministic results but i ran my model on CPU. Any thoughts on this are welcome.</p>\n", "Lable": "D"}
{"QuestionId": 35504948, "AnswerCount": 1, "Tags": "<matlab><caffe><matcaffe>", "CreationDate": "2016-02-19T12:06:00.093", "AcceptedAnswerId": "35548823", "Title": "Extract Caffe features with variable batch size in Matlab", "Body": "<p>I know how to extract Caffe feats / scores using the <code>matcaffe_demo.m</code> that is provided along with Caffe. However when using this file one has to provide a prototxt file that determines not only the network architecture but also the input dimensions including the <code>batch_size</code>.</p>\n\n<p>Since I'm processing the frames of videos of variable sequence lenght I need a way to use <code>matcaffe_demo.m</code> along with a variable batch size.</p>\n\n<p>Does anyone know how to do that?</p>\n\n<p>It would probably involve changing this line from <code>matcaffe_demo.m</code></p>\n\n<pre><code>% Initialize a network\nnet = caffe.Net(net_model, net_weights, phase);\n</code></pre>\n\n<p>to something that dynamically passes the current batch size needed dynamically to caffe</p>\n", "Lable": "D"}
{"QuestionId": 35527779, "AnswerCount": 0, "Tags": "<mongoose><mongoose-schema>", "CreationDate": "2016-02-20T19:10:43.713", "AcceptedAnswerId": null, "Title": "Specify type of nested array in mongoose?", "Body": "<p>My Schema</p>\n\n<pre><code>levels: {\n required: false,\n type: Array,\n 'default': [[], [], [], [], []]\n}\n</code></pre>\n\n<p>The problem: It's recognized as strings. But I want it to be of type number.</p>\n\n<p>So a valid example for a model would be:</p>\n\n<pre><code>[[0,1,2], [3,4,5], [6,7,8], [9,0,1], [2,3,4]]\n</code></pre>\n\n<p>So my question is: How do I specify the correct type?</p>\n\n<p>I've tried <code>[[Number]]</code> which wasn't working.</p>\n", "Lable": "No"}
{"QuestionId": 35553943, "AnswerCount": 1, "Tags": "<r>", "CreationDate": "2016-02-22T12:38:54.010", "AcceptedAnswerId": "35554443", "Title": "Counting each values by groups with NAs", "Body": "<p>I'm using this code for counting rows by fours. But it doesn't work when my df includes NA. How can I overcome this?</p>\n\n<pre><code>count &lt;- sapply(split.default(df, 0:(length(df)-1) %/% 4), rowSums)\n</code></pre>\n\n<p>Normally <strong>rowSums</strong> has <strong>na.rm=TRUE</strong> but when I tried it here I'm getting this:</p>\n\n<pre><code>Error in is.data.frame(x) : argument \"x\" is missing, with no default\n</code></pre>\n\n<p>I tried different versions of lapply, sapply or apply but no one worked. I'm just a starter so it will be very simple but I couldn't success.</p>\n\n<p>Thanks in advance.</p>\n\n<p>EDIT:\nSmall example:</p>\n\n<pre><code>id &lt;- 1:12\nb &lt;- c(0,0,1,0,0,1,1,0,0,0,1,1)\ndf &lt;-data.frame(b,b,b,b,b,b,b,b,b,b,b)\ndf$yeni &lt;- sapply(split.default(df, 0:(length(df)-1) %/% 4), rowSums)\n# b b.1 b.2 b.3 b.4 b.5 b.6 b.7 b.8 b.9 b.10 yeni.0 yeni.1 yeni.2\n#1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#2 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#3 1 1 1 1 1 1 1 1 1 1 1 4 4 3\n#4 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#5 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#6 1 1 1 1 1 1 1 1 1 1 1 4 4 3\n#7 1 1 1 1 1 1 1 1 1 1 1 4 4 3\n#8 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#9 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#10 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#11 1 1 1 1 1 1 1 1 1 1 1 4 4 3\n#12 1 1 1 1 1 1 1 1 1 1 1 4 4 3\n</code></pre>\n\n<p>My code doesn't work when my dataset is like this one</p>\n\n<pre><code>d &lt;- c(0,NA,1,0,0,1,1,0,0,0,1,1)\ndf &lt;-data.frame(b,b,b,b,b,b,b,b,b,b,b,d,d)\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 35554529, "AnswerCount": 1, "Tags": "<r><shiny>", "CreationDate": "2016-02-22T13:07:18.317", "AcceptedAnswerId": null, "Title": "\"seasonal\" R package not playing nice with shiny for input variables", "Body": "<p>I have been using the excellent 'seasonal' R package for X11/X13 ARIMA analysis, but I am seeing some erratic behavior with the <code>series()</code> call when using <code>input$</code> parameters in the <code>seas()</code> call.</p>\n\n<pre><code>fit_x &lt;- seas(x = tv, x11 = \"\", forecast.maxlead = as.numeric(input$months),\nforecast.probability = as.numeric(input$interval))\n# R executes the above statement ok\nx_fc &lt;- series(fit_x, \"forecast.forecasts\")\n# this doesn't work\n\nfit_x &lt;- seas(x = tv, x11 = \"\", forecast.maxlead = 12, forecast.probability = 0.90)\n# R executes the above statement ok\nx_fc &lt;- series(fit_x, \"forecast.forecasts\")\n# this does work\n</code></pre>\n\n<p>The stack trace is:</p>\n\n<pre><code>Warning: Error in seas: object 'input' not found\nStack trace (innermost first):\n 68: seas\n 67: eval\n 66: eval\n 65: reeval\n 64: series\n 63: observeEventHandler [/Users/koen/Shiny R/Apps/html/server.R#93]\n 1: runApp\n</code></pre>\n\n<p>Any insights? Thanks!</p>\n", "Lable": "No"}
{"QuestionId": 35578916, "AnswerCount": 2, "Tags": "<c++><visual-studio-2015><openmp>", "CreationDate": "2016-02-23T13:31:19.440", "AcceptedAnswerId": null, "Title": "Visual studio 2015 openmp support", "Body": "<p>I'm having trouble getting OpenMP support in Visual Studio 2015.</p>\n\n<p>I've configured the project options to use /openmp (project->properties->C/C++->language->OpenMP support:yes), the code is as follows (very simple code, to test OpenMP):</p>\n\n<pre><code>#include &lt;iostream&gt;\n#include &lt;omp.h&gt;\n\nint main(int argc, char* argv[])\n{\n int n = 0;\n\n#pragma omp parallel\n {\n std::cout &lt;&lt; std::endl &lt;&lt; \"Hello World!\";\n }\n return 0;\n}\n</code></pre>\n\n<p>Only one thread runs and \"Hello World!\" is printed only once.</p>\n", "Lable": "No"}
{"QuestionId": 35714505, "AnswerCount": 1, "Tags": "<c#><datetime><windows-services>", "CreationDate": "2016-03-01T04:11:31.417", "AcceptedAnswerId": null, "Title": "running windows service at midnight", "Body": "<p>my code executes every 5 minutes, within the 5 minutes if date changes my code will not run. how to handle this, please help </p>\n\n<p>I think i need to check currenttime.addminutes(5) and check if date\n changes and if date changes then need to set timer so that my code can\n run can any one help he how to implement this</p>\n\n<pre><code> if (Daily == \"true\")//run daily at 11:59:59\n {\n DateTime currentTime = DateTime.Now;\n int intervalToElapse = 0;\n DateTime scheduleTime = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 23, 59, 59, 999);\n\n if (currentTime &lt;= scheduleTime)\n intervalToElapse = (int)scheduleTime.Subtract(currentTime).TotalSeconds;\n else\n intervalToElapse = (int)scheduleTime.AddDays(1).Subtract(currentTime).TotalSeconds;\n\n _DailyTimer = new System.Timers.Timer(intervalToElapse);\n if (_DailyTimer.Interval == 0)//if date changes this will be false and the code will not run\n {\n string tempFilename = Convert.ToString(tempDailyTime.TimeOfDay).Replace(\":\", \"-\") + \".xlsx\";\n if (!File.Exists(tempDir + \"\\\\Daily\" + \"\\\\\" + ReportName + \"_\" + tempFilename))\n {\n GenerateDailyReport(ReportName, ReportID, ConnectionString, ReportColumnName, ReportBQuery, \"00:00:00\", \"23:59:59\", tempDir + \"\\\\Daily\", tempFilename);\n }\n }\n\n }\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 35735162, "AnswerCount": 3, "Tags": "<ubuntu><tensorflow>", "CreationDate": "2016-03-01T22:48:26.010", "AcceptedAnswerId": "35787103", "Title": "TensorFlow (GPU) libcudart.so.7.5 error -- cannot open shared object file", "Body": "<p>Installing TensorFlow with GPU on Ubuntu 14.04. Fairly new to the Ubuntu/UNIX environment so lots of things I don't get. When searching this issue, I came across instances of being unable to import CUDA 7.0 when they have CUDA 7.5 installed (since TensorFlow doesn't support 7.5). I have CUDA 7.0 installed, but it seems to be looking for 7.5 - why is this? I have in my .bashrc file the following lines:</p>\n\n<pre><code>export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64\"\nexport CUDA_HOME=/usr/local/cuda-7.0\n</code></pre>\n\n<p>But I'm still seeing the issue below... Anyone have any advice?</p>\n\n<pre><code>&gt;&gt;&gt; import tensorflow as tf\nTraceback (most recent call last):\n File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py\", line 23, in &lt;module&gt;\n from tensorflow.python import *\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py\", line 49, in &lt;module&gt;\n from tensorflow import contrib\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/__init__.py\", line 23, in &lt;module&gt;\n from tensorflow.contrib import layers\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.py\", line 68, in &lt;module&gt;\n from tensorflow.contrib.layers.python.layers import *\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py\", line 22, in &lt;module&gt;\n from tensorflow.contrib.layers.python.layers.initializers import *\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py\", line 24, in &lt;module&gt;\n from tensorflow.python.ops import random_ops\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/random_ops.py\", line 23, in &lt;module&gt;\n from tensorflow.python.framework import ops\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 39, in &lt;module&gt;\n from tensorflow.python.framework import versions\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/versions.py\", line 22, in &lt;module&gt;\n from tensorflow.python import pywrap_tensorflow\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py\", line 28, in &lt;module&gt;\n _pywrap_tensorflow = swig_import_helper()\n File \"/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py\", line 24, in swig_import_helper\n _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)\nImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory\n</code></pre>\n", "Lable": "D"}
{"QuestionId": 35749043, "AnswerCount": 1, "Tags": "<javascript><jquery><hashchange>", "CreationDate": "2016-03-02T13:48:55.197", "AcceptedAnswerId": null, "Title": "Trigger event on browser back and force refresh or reload the page with new url", "Body": "<p>This is my url:\nDOMAIN-NAME/#city=13&amp;pc=13&amp;car=18.26+2.97</p>\n\n<p>Now when user clicks browser back, the query string parameter gets removed one by one, like:</p>\n\n<p>First browser back:\nDOMAIN-NAME/#city=13&amp;pc=13&amp;car=18.26</p>\n\n<p>Second browser back:\nDOMAIN-NAME/#city=13&amp;pc=13</p>\n\n<p>Third browser back:\nDOMAIN-NAME/#city=13</p>\n\n<p>The problem is that on browser back the page is not reloading. </p>\n\n<p>I read about hashchange, pushstate but i am unable to figure correct way to reload page on browser back?</p>\n\n<p>I tried this:\nvar hash;</p>\n\n<pre><code>$(window).on('hashchange', function () {\n if (hash != window.location.hash) {\n alert('hash change called');\n //window.location.reload(true);\n }\n hash = window.location.hash;\n});\n</code></pre>\n\n<p>This is repeatedly reloading my page when i am refreshing it.</p>\n", "Lable": "No"}