diffxpy
diffxpy copied to clipboard
Error while installing diffxpy
Hi,
I followed the steps in the installation but I am still getting an error when I try to import diffxpy. Any help in fixing this is appreciated. Thank you.
Traceback
AttributeError Traceback (most recent call last)
<ipython-input-3-67d78b0a15d8> in <module>()
1
----> 2 import diffxpy.api as de
~/Downloads/diffxpy-master/diffxpy/api/__init__.py in <module>()
2 from ..log_cfg import logger, unconfigure_logging, enable_logging
3
----> 4 from . import test
5 from . import enrich
6 from . import stats
~/Downloads/diffxpy-master/diffxpy/api/test.py in <module>()
----> 1 from diffxpy.testing.base import two_sample
2 from diffxpy.testing.base import lrt
3 from diffxpy.testing.base import wald
4 from diffxpy.testing.base import t_test
5 from diffxpy.testing.base import wilcoxon
~/Downloads/diffxpy-master/diffxpy/testing/base.py in <module>()
14
15 import batchglm.data as data_utils
---> 16 from batchglm.models.glm_nb import Model as GeneralizedLinearModel
17
18 from ..stats import stats
~/Downloads/batchglm-master/batchglm/models/glm_nb/__init__.py in <module>()
----> 1 from .model import Model, Model_XArray
2 from .external import InputData
3 from .simulator import Simulator
4 from .estimator import AbstractEstimator, EstimatorStoreXArray
~/Downloads/batchglm-master/batchglm/models/glm_nb/model.py in <module>()
7 import numpy as np
8
----> 9 from .external import InputData
10 from .external import _Model_GLM, _Model_XArray_GLM, MODEL_PARAMS, _model_from_params
11
~/Downloads/batchglm-master/batchglm/models/glm_nb/external.py in <module>()
----> 1 from batchglm.models.base_glm import _Estimator_GLM, _EstimatorStore_XArray_GLM, ESTIMATOR_PARAMS
2 from batchglm.models.base_glm import InputData, INPUT_DATA_PARAMS
3 from batchglm.models.base_glm import _Model_GLM, _Model_XArray_GLM, MODEL_PARAMS, _model_from_params
4 from batchglm.models.base_glm import _Simulator_GLM
5 from batchglm.models.base_glm import closedform_glm_mean, closedform_glm_var
~/Downloads/batchglm-master/batchglm/models/base_glm/__init__.py in <module>()
----> 1 from .estimator import _Estimator_GLM, _EstimatorStore_XArray_GLM, ESTIMATOR_PARAMS
2 from .input import InputData, INPUT_DATA_PARAMS
3 from .model import _Model_GLM, _Model_XArray_GLM, MODEL_PARAMS, _model_from_params
4 from .simulator import _Simulator_GLM
5 from .utils import parse_design
~/Downloads/batchglm-master/batchglm/models/base_glm/estimator.py in <module>()
6 anndata = None
7
----> 8 from .model import MODEL_PARAMS
9 from .external import _Estimator_Base, _EstimatorStore_XArray_Base
10
~/Downloads/batchglm-master/batchglm/models/base_glm/model.py in <module>()
8 import xarray as xr
9
---> 10 from .input import InputData, INPUT_DATA_PARAMS
11 from .external import _Model_Base, _Model_XArray_Base
12
~/Downloads/batchglm-master/batchglm/models/base_glm/input.py in <module>()
9 import pandas as pd
10
---> 11 from .utils import parse_constraints, parse_design
12 from .external import _InputData_Base, INPUT_DATA_PARAMS
13
~/Downloads/batchglm-master/batchglm/models/base_glm/utils.py in <module>()
11 import patsy
12
---> 13 from .external import groupwise_solve_lm
14 from .external import weighted_mean, weighted_variance
15
~/Downloads/batchglm-master/batchglm/models/base_glm/external.py in <module>()
----> 1 from batchglm.models.base import _Estimator_Base, _EstimatorStore_XArray_Base
2 from batchglm.models.base import _InputData_Base
3 from batchglm.models.base import _Model_Base, _Model_XArray_Base
4 from batchglm.models.base import _Simulator_Base
5 from batchglm.models.base import INPUT_DATA_PARAMS
~/Downloads/batchglm-master/batchglm/models/base/__init__.py in <module>()
----> 1 from .input import _InputData_Base, INPUT_DATA_PARAMS
2 from .estimator import _Estimator_Base, _EstimatorStore_XArray_Base
3 from .model import _Model_Base, _Model_XArray_Base
4 from .simulator import _Simulator_Base
~/Downloads/batchglm-master/batchglm/models/base/input.py in <module>()
10 anndata = None
11
---> 12 from .external import pkg_constants, data_utils
13
14 logger = logging.getLogger(__name__)
~/Downloads/batchglm-master/batchglm/models/base/external.py in <module>()
----> 1 import batchglm.pkg_constants as pkg_constants
2 import batchglm.data as data_utils
~/Downloads/batchglm-master/batchglm/pkg_constants.py in <module>()
2 import multiprocessing
3
----> 4 import tensorflow as tf
5
6 TF_NUM_THREADS = int(os.environ.get('TF_NUM_THREADS', 0))
/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py in <module>()
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 try:
/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py in <module>()
53 parent_package_str='tensorflow.python',
54 child_package_str=(
---> 55 'tensorflow_estimator.python.estimator'))
56 del component_api_helper
57
/anaconda3/lib/python3.6/site-packages/tensorflow/python/tools/component_api_helper.py in package_hook(parent_package_str, child_package_str, error_msg)
54 parent_pkg = importlib.import_module(parent_package_str)
55 try:
---> 56 child_pkg = importlib.import_module(child_package_str)
57 except ImportError:
58 if error_msg:
/anaconda3/lib/python3.6/importlib/__init__.py in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127
128
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/__init__.py in <module>()
23 from __future__ import print_function
24
---> 25 import tensorflow_estimator.python.estimator.estimator_lib
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator_lib.py in <module>()
20
21 # pylint: disable=unused-import,line-too-long,wildcard-import
---> 22 from tensorflow_estimator.python.estimator.canned.baseline import BaselineClassifier
23 from tensorflow_estimator.python.estimator.canned.baseline import BaselineEstimator
24 from tensorflow_estimator.python.estimator.canned.baseline import BaselineRegressor
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/canned/baseline.py in <module>()
62 from tensorflow.python.training import training_util
63 from tensorflow.python.util.tf_export import estimator_export
---> 64 from tensorflow_estimator.python.estimator import estimator
65 from tensorflow_estimator.python.estimator.canned import head as head_lib
66 from tensorflow_estimator.python.estimator.canned import optimizers
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/__init__.py in <module>()
6 from __future__ import print_function as _print_function
7
----> 8 from tensorflow_estimator._api.v1 import estimator
9 _names_with_underscore = []
10 __all__ = [_s for _s in dir() if not _s.startswith('_')]
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py in <module>()
6 from __future__ import print_function as _print_function
7
----> 8 from tensorflow_estimator._api.v1.estimator import experimental
9 from tensorflow_estimator._api.v1.estimator import export
10 from tensorflow_estimator._api.v1.estimator import inputs
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py in <module>()
6 from __future__ import print_function as _print_function
7
----> 8 from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
9 from tensorflow_estimator.python.estimator.canned.linear import LinearSDCA
10 from tensorflow_estimator.python.estimator.canned.linear import linear_logit_fn_builder
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/canned/dnn.py in <module>()
38 from tensorflow_estimator.python.estimator.canned import head as head_lib
39 from tensorflow_estimator.python.estimator.canned import optimizers
---> 40 from tensorflow_estimator.python.estimator.head import head_utils
41 from tensorflow_estimator.python.estimator.head import regression_head
42
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/head/head_utils.py in <module>()
21 from tensorflow.core.framework import summary_pb2
22 from tensorflow.python.saved_model import signature_constants
---> 23 from tensorflow_estimator.python.estimator.head import binary_class_head
24 from tensorflow_estimator.python.estimator.head import multi_class_head
25
/anaconda3/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/head/binary_class_head.py in <module>()
22 from tensorflow.python.framework import ops
23 from tensorflow.python.keras import metrics
---> 24 from tensorflow.python.keras.utils import metrics_utils
25 from tensorflow.python.ops import array_ops
26 from tensorflow.python.ops import control_flow_ops
/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/utils/metrics_utils.py in <module>()
29 from tensorflow.python.framework import ops
30 from tensorflow.python.keras.utils.generic_utils import to_list
---> 31 from tensorflow.python.keras.utils.losses_utils import squeeze_or_expand_dimensions
32 from tensorflow.python.ops import array_ops
33 from tensorflow.python.ops import check_ops
/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/utils/losses_utils.py in <module>()
142
143 def _reduce_weighted_loss(
--> 144 weighted_losses, reduction=losses_impl.ReductionV2.SUM_OVER_BATCH_SIZE):
145 """Reduces the individual weighted loss measurements."""
146 if reduction == losses_impl.ReductionV2.NONE:
AttributeError: module 'tensorflow.python.ops.losses.losses_impl' has no attribute 'ReductionV2'
Hi, I'd recommend to install diffxpy via pip install diffxpy.
@davidsebfischer I'm not up to date to your batchglm changes, maybe the documentation should be changed to recommend pip?
Otherwise there will be a lot of questions like this one...
Hi @aditisk, I am on this, I am still doing changes to the backend which are necessary for this to run smoothly, I hope to push this in the next couple of days.
@davidsebfischer and @Hoeze thanks for your response. @davidsebfischer how can I know when this is ready to use ? Could you please comment here or is there somewhere that I can check for updates ?
Thanks.
Hi @aditisk, sorry for the delay! The installation from pypi should work smoothly now.
@davidsebfischer I think the installation worked. Thanks for the update. However, as mentioned in #127 I am unable to look at the tutorials to test the installation. Could you please look into why the tutorial links are down ? Thanks a lot.