'File system for s3 already registered when importing tensorflow_io
I installed tensorflow-io with pip install tensorflow-io
, when I import it I get:
tensorflow.python.framework.errors_impl.AlreadyExistsError: File system for s3 already registered
.
The trace is this.
import tensorflow_io as tfio
File "/opt/miniconda/lib/python3.7/site-packages/tensorflow_io/__init__.py", line 17, in <module>
from tensorflow_io.python.api import * # pylint: disable=wildcard-import File "/opt/miniconda/lib/python3.7/site-packages/tensorflow_io/python/api/__init__.py", line 19, in <module>
from tensorflow_io.python.ops.io_dataset import IODataset File "/opt/miniconda/lib/python3.7/site-packages/tensorflow_io/python/ops/__init__.py", line 96, in <module>
plugin_ops = _load_library("libtensorflow_io_plugins.so", "fs") File "/opt/miniconda/lib/python3.7/site-packages/tensorflow_io/python/ops/__init__.py", line 64, in _load_library
l = load_fn(f)
File "/opt/miniconda/lib/python3.7/site-packages/tensorflow_io/python/ops/__init__.py", line 56, in <lambda>
load_fn = lambda f: tf.experimental.register_filesystem_plugin(f) is None
File "/opt/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/load_library.py", line 178, in register_filesystem_plugin
py_tf.TF_RegisterFilesystemPlugin(plugin_location)
Can't get away from this problem, any ideas?
Solution 1:[1]
Do not know if you solved the problem but here is what I did:
I installed the cpu version (instead of the gpu one):
conda create -n tf tensorflow
conda activate tf
keras:
conda install -c conda-forge keras
also:
pip install tensorflow-io
I hope that it helps.
Solution 2:[2]
Yes, i also verified that it works when you have installed cpu version of tensorflow. However the issue still exists for GPU version, anybody has solution for this issue with GPU version?
Solution 3:[3]
Okey... after a bit more trying I found how to make it work, only with some warning popping up (but it works :D).
In my case, I am using a 3080 GPU an probably this is the reason why it doesn't work but anyway, here is the solution:
- (might be worth to start in a new environment)
- Go to your new environment
- use pip to install the NIGHTLY build of tensorflow (for windows): pip install tf-nightly-gpu
- From here, it will be a road of uninstalling and installing libraries (like 10 times or so). It will say something like "google module is not found" or "wrap" and so on.
For example, if it says: "Google module was not found" In the terminal do:
pip uninstall google
pip install google
And repeat step 4 until you can run the tensorflow library without getting any more ERRORS.
P.S.: you will get warnings in the terminal saying that "X" library is not compatible but is okey; just repeat doing step 4 until there are no more errors when trying to import the tensorflow library.
I hope that this helps. :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Veeranjaneyulu TOka |
Solution 3 | Valentin Craciun |