ImportError dependent on import order
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python, tensorflow
- Ambito
- machine-learning
Direzione di ricerca
Riproduci l'installazione di conda e pip, quindi esegui i due ordini di importazione mostrati nel report. Inizia in tensorflow_probability/python/init.py da _validate_tf_environment e analizza perché importare prima tensorflow lascia tf_keras non disponibile; il lavoro è completato quando l'installazione documentata viene importata correttamente in entrambi gli ordini.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi,
Working on an M3 macbook pro in macOS 15.6.
Using miniforge3.
Creating a conda env from scratch.
Running
conda install python pip ipython
pip install tensorflow tensorflow_probablity tensorflow-keras
to install python 3.13 and
tensorflow==2.20.0
tensorflow-probability==0.24.0
tensorflow_keras==0.1
then in a python terminal
In [1]: import tensorflow_probability
In [2]: import tensorflow
succeeds, and I can use tf and tf keras and import and use my own modules which use them . But
In [1]: import tensorflow
In [2]: import tensorflow_probability
returns the (familiar) error
File ~/miniforge3/envs/tensorflow/lib/python3.13/site-packages/tensorflow_probability/python/__init__.py:79, in _validate_tf_environment(package)
77 if required_tensorflow_version[0] == '2':
78 try:
---> 79 import tf_keras # pylint: disable=unused-import
80 except (ImportError, ModuleNotFoundError):
81 # Print more informative error message, then reraise.
82 print('\n\nFailed to import TF-Keras. Please note that TF-Keras is not '
83 'installed by default when you install TensorFlow Probability. '
84 'This is so that JAX-only users do not have to install TensorFlow '
(...) 87 'This can be be done through installing the '
88 'tensorflow-probability[tf] extra.\n\n')
ModuleNotFoundError: No module named 'tf_keras'
When importing tf and tfp at the top of my own modules, this error also appears when I import mymodule no matter what order the import of tf and tfp happens in the module file.
I am note even sure how to debug this! I guess something to do with namespaces getting messed up, but I am very much a user not a dev...
- Lingua principale
- Jupyter Notebook
- Stelle
- 4.4k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tensorflow/probability
-
KL divergence between two `TransformedDistribution`s with a shared non-injective bijector (`AbsoluteValue`) returns the base KLForse già presa @Andreas-Hum l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
tensorflow/probability#2036 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
tensorflow/probability#2034 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
tensorflow/probability#2021 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
tensorflow/probability#2015 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
tensorflow/probability#2013 ·
Tutte le issue di tensorflow/probability
Issue simili
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex failsForse già presa @vrjdev l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DoubleML/doubleml-for-py#455 ·
I maintainer di solito rispondono entro 1 giorno
-
Install page: spectarf's CUDA engine fails with PyTorch for CUDA 13.0 (nvvmError: ERROR_INVALID_IR)Forse già presa @lukepolson l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
PyTomography/PyTomography#435 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner friendly
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
aws-samples/sample-per-model-bedrock#821 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
instadeepai/InstaNovo-FM#50 ·