This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| checkpoint_prefix = os.path.join(FLAGS.checkpoint_dir, "saved_checkpoint") | |
| saver.save(sess, checkpoint_prefix, global_step=0, latest_filename=checkpoint_state_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def inference(images): | |
| """Build the CIFAR model up to where it may be used for inference. | |
| Args: | |
| Returns: | |
| logits: Output tensor with the computed logits. | |
| """ | |
| print('Inferencing') | |
| # Reshape input picture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2015 Google Inc. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install build tools | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python-matplotlib libblas-dev liblapack-dev libatlas-base-dev python-dev python-pydot linux-headers-generic linux-image-extra-virtual unzip python-numpy swig python-pandas python-sklearn unzip | |
| sudo pip install -U pip | |
| # Install CUDA 7 | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1410/x86_64/cuda-repo-ubuntu1410_7.0-28_amd64.deb | |
| sudo dpkg -i cuda-repo-ubuntu1410_7.0-28_amd64.deb && rm cuda-repo-ubuntu1410_7.0-28_amd64.deb | |
| sudo apt-get update | |
| sudo apt-get install -y cuda |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This is a POST request example | |
| * use it for sending request with parameters and getting response frome server | |
| */ | |
| // Sending POST request to server and getting response as a String | |
| String responseFromServer = startUrlConnection("http://www.some_website.domain", | |
| "parameter1="+parameter_variable1+"¶meter2="+parameter_variable2); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| HttpClient client = new DefaultHttpClient(); | |
| String postURL = "http://somepostaddress.com"; | |
| HttpPost post = new HttpPost(postURL); | |
| List<NameValuePair> params = new ArrayList<NameValuePair>(); | |
| params.add(new BasicNameValuePair("user", "kris")); | |
| params.add(new BasicNameValuePair("pass", "xyz")); | |
| UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8); | |
| post.setEntity(ent); | |
| HttpResponse responsePOST = client.execute(post); |
NewerOlder