ImportError dependent on import order
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python, tensorflow
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Tái hiện quá trình cài đặt conda và pip, sau đó chạy hai thứ tự import được nêu trong báo cáo. Bắt đầu trong tensorflow_probability/python/init.py tại _validate_tf_environment và kiểm tra lý do việc import tensorflow trước khiến tf_keras không khả dụng; hoàn tất khi bản cài đặt được ghi trong tài liệu import thành công theo cả hai thứ tự.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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...
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 4.4k
- Fork
- 1.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/probability
-
KL divergence between two `TransformedDistribution`s with a shared non-injective bijector (`AbsoluteValue`) returns the base KLCó thể đã có người làm @Andreas-Hum đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
tensorflow/probability#2036 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
tensorflow/probability#2034 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
tensorflow/probability#2021 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
tensorflow/probability#2015 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
tensorflow/probability#2013 ·
Tất cả issue của tensorflow/probability
Issue tương tự
-
[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 failsCó thể đã có người làm @vrjdev đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DoubleML/doubleml-for-py#455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Install page: spectarf's CUDA engine fails with PyTorch for CUDA 13.0 (nvvmError: ERROR_INVALID_IR)Có thể đã có người làm @lukepolson đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
PyTomography/PyTomography#435 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
beginner friendly
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
aws-samples/sample-per-model-bedrock#821 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
instadeepai/InstaNovo-FM#50 ·