So I am trying to access the open-source SAR dataset SpaceNet 6: Expanded Dataset. I particularly need the SAR-SLC data as I want to have the raw complex-valued dataset.
I downloaded the dataset successfully using aws. Now the issue arises when I use python to open the .tif files. I tried OpenCV, matplotlib, PIL and skimage. Here the errors I get:
OpenCV: [ WARN:0#1.074] global /io/opencv/modules/imgcodecs/src/grfmt_tiff.cpp (462) readData OpenCV TIFF: TIFFRGBAImageOK: Sorry, can not handle images with 32-bit samples.
Matplotlib: cannot identify image file '<path to .tif file>'.
PIL: cannot identify image file '<path to .tif file>'.
skimage: TiffPage 0: data type not supported: 532.
Has someone already succeeded in opening this library?
I've seen that this code uses a library called solaris. I tried installing it but it requires TensorFlow version to be tf v1.13 and I already have version 2 and I need it. I tried creating a new environment to install it from scratch. As the documentation says I need to install GDAL so at this point why not? sudo apt-get install libgdal-dev but then I still got errors like:
ERROR: Cannot install solaris==0.0.1, solaris==0.0.2, solaris==0.0.3, solaris==0.1.0, solaris==0.1.1, solaris==0.1.2, solaris==0.1.3, solaris==0.2.0, solaris==0.2.1, solaris==0.2.2, solaris==0.3.0 and solaris==0.4.0 because these package versions have conflicting dependencies.
The conflict is caused by:
solaris 0.4.0 depends on torch>=1.3.1
solaris 0.3.0 depends on torch>=1.3.1
solaris 0.2.2 depends on torch>=1.3.1
solaris 0.2.1 depends on torchvision>=0.4.2
solaris 0.2.0 depends on torchvision>=0.3.0
solaris 0.1.3 depends on torchvision>=0.3.0
solaris 0.1.2 depends on torchvision>=0.3.0
solaris 0.1.1 depends on torchvision>=0.3.0
solaris 0.1.0 depends on torchvision>=0.3.0
solaris 0.0.3 depends on torchvision>=0.3.0
solaris 0.0.2 depends on torchvision>=0.3.0
solaris 0.0.1 depends on torch>=1.0.1
And it was a NEW environment without tf nor pytorch installed.
This, although a crapy solution (Do I really need to create a new env, install tf and pytorch and lot of dependencies, install GDAL, etc to open an image?) at this point I am Ok with whatever works.
Related
I have the same problem as this post:
Declaring a var usable by another function using a import in a secondary script, but the answer does not work on my side.
For context: basemap and basemap-data-hires are installed, yet when using resolution = 'f' it triggers the following error:
OSError: Unable to open boundary dataset file. Only the 'crude' and 'low',
resolution datasets are installed by default.
If you are requesting an, 'intermediate', 'high' or 'full'
resolution dataset, you may need to download and install those
files separately with
conda install -c conda-forge basemap-data-hires.
Here is the conda list output:
C:\Users\AlxndrLhr>conda list
# packages in environment at C:\Users\AlxndrLhr\Anaconda3\envs\map:
#
# Name Version Build Channel
basemap 1.2.2 py39h689385a_5 conda-forge
basemap-data 1.3.2 pyhd8ed1ab_0 conda-forge
basemap-data-hires 1.3.2 pyhd8ed1ab_0 conda-forge
As you can see, basemap-data-hires is present. I tried installing it in the base environment of conda, didn't work either.
Before basemap 1.3.0, the library was packaged in conda-forge by splitting the heavy data files into a separate basemap-data-hires conda package (and whose files were installed in the share folder).
Since basemap 1.3.0, a complete reorganisation of the basemap package has been done upstream by splitting the library into basemap, basemap-data and basemap-data-hires. These three packages are Python packages and get installed in the corresponding Python site-packages folder. This new structuring is propagated to the conda-forge packages.
Your installation is mixing the old basemap conda package (pre-1.3.0) with the new basemap-data-hires conda package (post-1.3.0). You can solve the issue by pinning versions during installation, either the following to install the latest basemap:
conda install "basemap>=1.3.0" "basemap-data-hires>=1.3.0"
or the following to install the pre-1.3.0 version:
conda install "basemap==1.2.2" "basemap-data-hires==1.2.2"
When downloading numpy I encountered a failure at the end,
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'c:\\python310\\Scripts\\f2py.exe' -> 'c:\\python310\\Scripts\\f2py.exe.deleteme'
and while installing aitextgen i received this error:
ERROR: Cannot install aitextgen==0.3.0, aitextgen==0.4.0, aitextgen==0.4.1, aitextgen==0.5.0, aitextgen==0.5.1 and aitextgen==0.5.2 because these package versions have conflicting dependencies.`
The conflict is caused by:
aitextgen 0.5.2 depends on torch>=1.6.0
aitextgen 0.5.1 depends on torch>=1.6.0
aitextgen 0.5.0 depends on torch>=1.6.0
aitextgen 0.4.1 depends on torch>=1.6.0
aitextgen 0.3.0 depends on torch>=1.6.0
No idea what's causing this. I've reinstalled Python using chocolatey. Is it an issue involving an installation path? Any help is greatly appreciated.I installed these using the pip3 install [module] method.
If I judge your path to python correctly:
c:\\python310\\
Then you have python 3.10 installed. This is at this point only a beta version, not even officially released.
aitextgen 0.5.2 depends on torch>=1.6.0
The issue here is that torch only has whl files available on pypi and only up to python 3.9. You will face this problem often, as it will take some time, probably after the release scheduled in october to have official support for many python modules.
You options:
Install an earlier version of python - this is probably your best option. You probably don't depend on any specific python 3.10 features
Download and compile torch from source - this will be both tricky, esspecially on windows and is also not guaranteed to work. There is at this point no official support for python 3.10 from torch. You will probably also have to solve a similar problem for other modules when sitcking with pyhon 3.10
I have been following the installation guide from http://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/
I got & am using:
conda 4.3.22
Python 3.5.3 :: Anaconda 4.4.0 (32-bit)
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
I successfully installed theano & keras. HOWEVER, I FAIL at installing tensorflow. Please HELP.
I created a conda ‘tensorflow’ environment with python 3.5. With command
『pip install –ignore-installed –upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl』
I got ERROR saying
『tensorflow-1.2.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform』
So i changed to version 1.0.1 and same error.
Version 1.1.0 also same error.
So i deactivated the environment, and type command
『conda install -c conda-forge tensorflow』
I got ERROR
『PackageNotFoundError: Package missing in current win-32 channels』
Instead it says the close match found is “xtensor” which i know is a C++ library that I'm not looking for.
Is it because I’m using a 32-bit Windows 10?
So I also tried running the following :
『python -m pip install –upgrade tensorflow』
and got ERROR of
『Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow』
What more requirements do i need for this?
I tried 『pip3 install tensorflow』 but somehow it could not recognized ‘pip3’. So i type 『where pip3』 and it could not find files for the given pattern. So i type『where python』. It ouput the directory of my python. Then checked if it’s already put under the path inside the environmental variable. And it has. But i still couldn't use pip3 command.
I have tried all the solutions provided from people having similar problem with me and none of them work.
This question has been answered here.
In short, yes, TensorFlow does not support 32-bit platforms. Although if you only plan on writing abstract high-level Keras code then Theano will do just fine.
After successfully installing libtiff on win7 I try to run:
tif = TIFF.open("sometiff.tiff")
I get the following error:
File "C:\Python27\ArcGIS10.2\lib\site-packages\libtiff\libtiff_ctypes.py",
line 41, in <module> raise
ImportError: Failed to find TIFF library.
Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..
I'm not sure what I need to add to the windows path to make this work successfully.
The directory that contains the dll for libtiff needs to be in your PATH environment variable.
If you did pip install libtiff, then you would have installed it using libtiff from pypi. This seems to be a "wrapper" around libtiff, so you will also need to install the actual libtiff Setup program.
Depending on what you are doing, you may want to look into a more complete distribution of python on windows such as Anaconda, which seems to be quite popular, or Enthought, which the subscription version is well supported. (I believe there is a subscription version of Anaconda, but I have not used it.)
I have installed OpenCV and the detail is as follows:
brew info opencv homebrew/science/opencv: stable 2.4.12 (bottled),
HEAD Open source computer vision library http://opencv.org/
/usr/local/Cellar/opencv/2.4.12 (225 files, 36M)
Then, I run the Python to import the library of cv and get the ImportError
ImportError: dlopen(./cv2.so, 2): Library not loaded:
/usr/local/lib/libpng16.16.dylib Referenced from:
/usr/local/Cellar/opencv/2.4.12/lib/libopencv_highgui.2.4.dylib
Reason: Incompatible library version: libopencv_highgui.2.4.dylib
requires version 35.0.0 or later, but libpng16.16.dylib provides
version 34.0.0
I have found some related questions and follow the suggestion to reinstall the libpng to obtain the latest version. Unfortunately, it still does not work..
Here is the details of libnpg:
brew info libpng libpng: stable 1.6.19 (bottled), HEAD Library for
manipulating PNG images http://www.libpng.org/pub/png/libpng.html
/usr/local/Cellar/libpng/1.6.19 (17 files, 1.2M)
I finally tackle the problem!
The "libpng16.16.dylib" in the directory: /usr/local/lib/libpng16.16.dylib is loaded when importing the cv, cv2 modules.
Even I update the version of libpng to be the latest version, new version of "libpng16.16.dylib" is still stored at: /usr/local/Cellar/libpng/1.6.19 but not /usr/local/lib/libpng16.16.dylib.
Therefore, I copy the latest version of "libpng16.16.dylib" to the directory: /usr/local/lib/libpng16.16.dylib, and it is solved!
I am not sure that it is the most appropriate solution, but at least it works.