I'm a freshman, and have just started my trip toward machine learning. I followed a book and the video tutorial of Josh Gordon (https://www.youtube.com/watch?v=cSKfRcEDGUs), but was stopped at "TensorFlow for poets", in which says:
# In Docker
python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/flower_photos
And I got 2 problems here:
there's no such directory called 'image_retraining' nor file called retrain.py;
the docker can't be opened.
The first problem seems easy to solve as I found the Tensorflow Retrain on Windows,
but the second one remain unsolved. Every time I start the "Boot2DockerStart", it will flash an error saying 'error in run: Failed to start machine "boot2docker-vm": exit status 1' and then quit. So I searched, most answers are saying that the Virtualization is disabled, but I checked that though the Task Manager, On which the Virtualization Status is 'Enable', which really confused me...
So I wonder: How to fix the docker problem? Is there a way that can run the Retrain without docker? And, if both the problems are difficult to solve, am I supposed to install a linux?
P.S. I'm using Win10, python version is 3.5 which is installed using Anaconda and coding in VS2015, tensorflow version is gpu-0.12.1
You can see a more complete set of instructions in "TensorFlow For Poets - Setting up" (for Linux and Mac)
On Windows, make sure your Docker Toolbox (the one using Boot2docker) is properly setup.
Make sure, on Windows 10, that you don't have the Hyper-V Windows already activated, as both Hyper-V and VirtualBox have some issues running together.
Related
Computational Science SE question How amenable is this 2D Frenkel–Kontorova-like energy minimization problem in Python to the use of a modest PC + GPU? (Heavy reliance on indexing) contains a short example script and note 3 links to my first attempt at profiling using scalene
The results were uninformative, so I followed a recommendation that I try the --profile-all option. After running for 30 minutes without finishing on a script that took seconds to run I added a CPU percent limit; what I assume means only things that used at least 2% of the CPU time would be profiled in depth.
scalene --html --outfile prof.html --profile-all --cpu-percent-threshold 2 myscript.py
I received a two line error and was exited from python in a normal way.
Error getting real path: 2
Scalene error: received signal SIGABRT
This issue was closed in scalene issue #110 and there are links there to
https://github.com/plasma-umass/scalene/commit/6636d95d7ea9a16adedaedbd4ff0926374798f2b
Q: How do I use Scalene with PyTorch?
A: Scalene works with PyTorch version 1.5.1. There's a bug in newer versions of PyTorch (https://github.com/pytorch/pytorch/issues/57185) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110).
there's more information there as well
and
Pytorch open issue #57185 Segmentation fault with ITIMER_REAL PyTorch throws SIGSEGV when running alongside timer on MacOS x86
Question: Is there a workaround to successfully profile python script using scalene profiler on macOS? Or should I just move to a machine with Windows or Linux and forget about trying for now?
The message, Error getting real path: 2, seems to have to do with scalene finding your script or a path internal to your script possibly.
Ensure you're referencing a full, valid path for myscript.py, taking into account which directory you're at in the terminal. You may need to change directory.
The SIGABRT message is different from the SIGSEGV issue listed, though, if you wanted to test it, you could uninstall PyTorch (pip uninstall torch) and reinstall a specific version (pip install 'torch==1.5.1').
Im trying to run Stockfish chess engine, but in the line that execute the binary give me this error:
Script:
import chess
import chess.uci
import chess.engine
fen = 'r2qkb1r/1p1bpp1p/p1n2p2/8/B1pP4/5N2/P1P2PPP/RN1QK2R w KQkq - 0 12'
board = chess.Board(fen)
handler = chess.uci.InfoHandler()
engine = chess.uci.popen_engine('/home/egqbe6ns/public_html/stockfish_10_x64')
Error:
/home/egqbe6ns/public_html/stockfish_10_x64: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/egqbe6ns/public_html/stockfish_10_x64)
/home/egqbe6ns/public_html/stockfish_10_x64: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /home/egqbe6ns/public_html/stockfish_10_x64)
Im in a shared server, other python script execute ok!
How can I update this libc6 with PUTTY SSH?
How can I update this libc6 with PUTTY SSH?
You can't.
Your stockfish_10_x64 binary was built on a GLIBC-2.17 or later system, and will only run on a system with that version of GLIBC (or a later one).
The only (not completely true, see below) way to get this working is to update the GLIBC on the server, and if you don't have root on that server, you can't do that.
You would need to get a different build of stockfish_10_x64, or run on a different server.
P.S. You may be tempted to try LD_LIBRARY_PATH or LD_PRELOAD solutions, but they will not work.
P.P.S. Using explicit loader invocation with a newer GLIBC might work. Something like this:
install GLIBC-2.17 or later into /home/egqbe6ns/libc.
invoke stockfish_10_x64 like so:
/home/egqbe6ns/libc/lib/ld-linux-x86-64.so.2 --library-path=/home/egqbe6ns/libc/lib64:/lib64 /home/egqbe6ns/public_html/stockfish_10_x64
A couple of days ago I cloned a git repository and tried to make a build out of that code with PyBuilder; however, I have not been able to do so.
Every time I run pyb -X -E jenkins-zipfile-release in Bash I get the following error: BUILD FAILED - Error initializing ctypes. The thing is, none of my colleagues have this problem, we don't know why.
The traceback tells me the problem is here: .../pyenv/versions/2.7.14/lib/python2.7/site-packages/oscrypto/_openssl/_libcrypto_ctypes.py
We thought the problem that my python was not correctly compiled with SSL. We even had a different SSL version. I replaced LibreSSL with OpenSSL, but the problem persists.
Another person told me that maybe the oscrypto libraries are conflicting (one from the environment and the other one from the project's lib directory) How can I check that?
I would deeply appreciate if someone could point me in the right direction, I've been trying for two days now.
There was an issue with regards to running oscrypto in a High Sierra. The issue was fixed and it will be a part of the next release.
More info: https://github.com/wbond/oscrypto/issues/22
I have a simulation inside Blender that I would like to control externally using the TensorFlow library. The complete process would go something like this:
while True:
state = observation_from_blender()
action = find_action_using_tensorflow_neural_net(state)
take_action_inside_blender(action)
I don't have much experience with the threading or subprocess modules and so am unsure as to how I should go about actually building something like this.
Rather than mess around with Tensorflow connections and APIs, I'd suggest you take a look at the Open AI Universe Starter Agent[1]. The advantage here is that as long as you have a VNC session open, you can connect a TF based system to do reinforcement learning on your actions.
Once you have a model constructed via this, you can focus on actually building a lower level API system for the two things to talk to each other.
[1] https://github.com/openai/universe-starter-agent
Thanks for your response. Unfortunately, trying to get Universe working with my current setup was a bit of a pain. I'm also on a fairly tight deadline so I just needed something that worked straight away.
I did find a somewhat DIY solution that worked well for my situation using the pickle module. I don't really know how to convert this approach into proper pseudocode, so here is the general outline:
Process 1 - TensorFlow:
load up TF graph
wait until pickled state arrives
while not terminated:
Process 2 - Blender:
run simulation until next action required
pickle state
wait until pickled action arrives
Process 1 - TensorFlow:
unpickle state
feedforward state through neural net, find action
pickle action
wait until next pickled state arrives
Process 2 - Blender:
unpickle action
take action
This approach worked well for me, but I imagine there are more elegant low level solutions. I'd be curious to hear of any other possible approaches that achieve the same goal.
I did this to install tensorflow with the python version that comes bundled with blender.
Blender version: 2.78
Python version: 3.5.2
First of all you need to install pip for blender's python. For that I followed instructions mentioned in this link: https://blender.stackexchange.com/questions/56011/how-to-use-pip-with-blenders-bundled-python. (What I did was drag the python3.5m icon into the terminal and then further type the command '~/get-pip.py').
Once you have pip installed you are all set up to install 3rd party modules and use them with blender.
Navigate to the bin folder insider '/home/path to blender/2.78/' directory. To install tensorflow, drag the python3.5m icon into terminal, then drag pip3 icon into terminal and give the command install tensorflow.
I got an error mentioning module lib2to3 not found. Even installing the module didn't help as I got the message that no such module exists. Fortunately, I have python 3.5.2 installed on my machine. So navigate to /usr/lib/python3.5 and copy the lib2to3 folder from there to /home/user/blender/2.78/python/lib/python3.5 and then again run the installation command for tensorflow. The installation should complete without any errors. Make sure that you test the installation by importing tensorflow.
Ok, dear friends, in the previous version of this message I had written "Despite my age (I'm almost 62 years!) I have had enough experience of programming in Pascal behind, but I'm an absolute novice in "Machine learning" and projecting Neural Networks in Python, as I would like. So, when I recently tried to download Anaconda3 4.2.0, Python version 3.5, and to install it in my Windows 10 Workstation, I received several error messages". I had obviously underestimated the effects of age ;-), because finally I realized I had to log in as Administrator, and launch the installation program from inside the "SysWOW64" directory. Now everything is Ok! Thank you everybody for your help!!!
P.S.: the error messages I received before to find the solution were: "unable to run mk_menus" & "unable to run mk_dirs" from _nsis.py file (in the Anaconda3/Lib directory) and "unable to add path Anaconda3 to Windows" from .cio-config.py (in the Anaconda3/pkgs directory).