Accidentally cancelled inceptionV3 during install, now can't install at all - python

i was setting up tensorflow for image classification, and after i ran :
-m scripts.retrain
--bottleneck_dir=tf_files/bottlenecks
--model_dir=tf_files/models/"${ARCHITECTURE}"
--summaries_dir=tf_files/training_summaries/"${ARCHITECTURE}"
--output_graph=tf_files/retrained_graph.pb
--output_labels=tf_files/retrained_labels.txt
--architecture="${ARCHITECTURE}"
--image_dir=tf_files/flower_photos
It automatically started installing inception, i realized that i needed to change some options so i cancelled the install of inception.
Now i believe that i have a half install that doesn't let me install the full package or use the half package.
I may be wrong, but any suggestions would be appreciated.
FYI: i've run :
pip install inception, to which i receive a "python setup.py egg_info" failed with error code 1 in {my local/temp dir}
I also just tried running the scripts.retrain again, to which i receive a "EOFError: compressed file ended before the end-of-stream marker was reached"
Running on Windows 7

Related

Running pip install twice to see changes ("developer mode") -- second install fails but first works

I am wondering how to use pip to develop a Python package which is going through many revisions rapidly. My work flow is to write C++ code, compile and install with pip install and test my code.
Then, I would like to change some underlying C++ code, recompile and reinstall with pip, test the new feature, change something else, go back etc. until my package is ready.
Why did pip install ./cmake_example work well the first time but when making changes to the code, reinstalling with recompiling produced an error? I just re-ran the command pip install ./cmake_example.
I changed a single line of C++ code in an innocuous way (adding +1 in the 'add' function just to see if I can change code and recompile) and the code compiled fine in my IDE without pip.
My basic idea was to use pip following this method to avoid having to hackishly insert my shared object into some python directory each time I make a change.
I used the cmake_example from pybind here and followed the steps and did pip install ./cmake_example and it worked very well. I ran the example fine in a Python console.
Then, I changed some code (just added +1 to the adding function), so nothing substantial and wanted to re-install the package.
I then got this error:
Building wheels for collected packages: cmake-example
Building wheel for cmake-example (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for cmake-example (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [65 lines of output]
running bdist_wheel
running build
running build_ext
CMake Error at CMakeLists.txt:2 (project):
Running
'/tmp/pip-build-env-q_8_pyjk/overlay/bin/ninja' '--version'
failed with:
No such file or directory
and
ERROR: Could not build wheels for cmake-example, which is required to
install pyproject.toml-based projects
I have tried pip uninstall cmake_example and then reinstall but to no avail. The upgrade function did not work either. Does pip change something in the project folder?
PS: The makers of pybind11 also provide a scikit example here where removing the cache for repeated builds is not necessary. The cmake_example seems to be intended for legacy projects that do not use the cmake extension scikit. So if the structure of the cmake_example is essential to the project, removal of the cache is the only way to go.
I found that deleting the build directory inside the cmake_example directory resolved the problem and pip install ./cmake_example worked again as it did the first time. You can combine the two commands:
rm -rf ./cmake_example/build && pip install ./cmake_example
Looking a little closer, (for me) it was sufficient to delete cmake_example/temp.linux-x86_64-3.8/CMakeCache.txt. I suspect the lines
//Program used to build from build.ninja files.
CMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-yqopewjn/overlay/bin/ninja
inside CMakeCache.txt mean that cmake caches the path to the ninja executable, but the second time around the temporary path is different, so it can no longer be found where cmake expects it.

install Derivatives of hachoir library into Google Colab

How can I install derivatives of hachoir library like hachoir-core Or hachoir-metadata on GoogleColab? I tried this way !pip install hachoir-metadata but I got the error
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-install-8op487i8/hachoir-metadata/
!pip2 install hachoir-metadata works fine for me, and https://pypi.org/project/hachoir-metadata/ says "Last released in 2010" suggesting the package is incompatible with Python 3. Try changing your notebook setting to Python 2.

Fatal error while installing keras

I was trying to install keras (for using LSTM) on my Windows 10 system in Anaconda using the method provided by Yelaman. But after running the command pip install git+git://github.com/Theano/Theano.git, I received the following fatal error -
C:\Anaconda>pip install git+git://github.com/Theano/Theano.git
Collecting git+git://github.com/Theano/Theano.git
Cloning git://github.com/Theano/Theano.git to
c:\users\krishna\appdata\local\temp\pip-reettr-build fatal: protocol
error: bad line length character:
Er
Command "git clone -q git://github.com/Theano/Theano.git
c:\users\krishna\appdata\local\temp\pip-reettr-build" failed with
error code 128 in None
I don't have a github account but i use git using bitbucket (if that matters).
Could anyone explain to me what error I am committing and if there is a way out? My main goal is to use keras in Anaconda in Windows.
Thanks!
It seems that the error may be because we have a git repository listed as a dependency. Not still fully sure, though. (Source)
The solution is to replace pip install git+git://github.com/Theano/Theano.git with pip install git+http://github.com/Theano/Theano.git i.e. replacing the second git with http (this works since the repository is public)

Installing Kartograph / GDAL / Etc. with PIP and virtualenv

Running into a few different problems here. Trying to install Kartograph and first installing dependencies. Here are my steps and results thus far:
Install GDAL from .pkg. Goes well. No problems here.
Try to install Kartograph using the default instructions for OSX with several packages. This fails with the following errors:
File "", line 4, in
main.gdal_config_error: [Errno 2] No such file or directory
Command python setup.py egg_info failed with error code 1 in
/Users/chris/ENV/build/GDAL
Ok, no dice. So then I try the install excluding GDAL as that seems to be presenting a problem to pip's install of Kartograph. That doesn't work either and produces the following errors:
raise KeyError('please set the environment variable PROJ_DIR to point to the location of your proj.4 installation')
KeyError: 'please set the environment variable PROJ_DIR to point to
the location of your proj.4 installation'
---------------------------------------- Command python setup.py egg_info failed with error code 1 in /Users/chris/ENV/build/pyproj
Now, I've edited the activate script of my virtualenv with the PYTHONPATH variable assignment per the Kartograph documentation. However, not sure that helped or has changed anything.
Has anyone run into a similar sequence of errors and if so, how did you solve this issue?
I managed to fix this error but now I'm stuck at another error.
Anyway this is what I did:
I installed the PROJ framework package from here:
http://www.kyngchaos.com/software/frameworks
Then I ran the following in Terminal to add the installation path to PROJ_DIR (as instructed in the error message):
$ export PROJ_DIR=$PROJ_DIR:/Library/Frameworks/PROJ.framework/Programs
Apparently PROJ is included in the GDAL framework so maybe the first step is unnecessary.
Update: It seems the path is lost when you close Terminal

Installing (build) matplotlib in mac osx lion

I installed pynum and scipy (on osx Lion with python 2.7), but when I tried to build matplotlib
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
I've got these errors:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:242: error: declaration for parameter ‘FMFontDirectoryFilter’ but no such parameter
src/_macosx.m:5912: error: expected ‘{’ at end of input
lipo: can't open input file: /var/folders/qw/pr2f7vq91b3c3ngkxrrqplm8zkv09r/T//ccAgEklo.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Could somebody please tell me what is the problem?
P.S.
At first I tried to install it in this way:
pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev
but it does not worked for me
I always find this process more painful than it should be, but I've done it a few times now and I believe that these steps should get you set up:
Get Xcode 4.3.2, it's required for some of the later steps.
Download the latest version of python for OSX from python.org
Grab the Scipy superpack.
Uninstall any previous versions of numpy/matplotlib/scipy that you currently have. That includes doing cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ and moving any numpy/matplotlib/scipy directories or eggs into a temp directory.
cd ~/Downloads(or wherever you downloaded the superpack script to) and run sh install_superpack.sh. Answer no to the question are you installing from a repository cloned to this machine or you'll be confused about why the script keeps failing.
That should be it! You should now be able to boot up the python console and import numpy, scipy, matplotlib.

Categories