AdneneBoumessouer / MVTec-Anomaly-Detection

This project proposes an end-to-end framework for semi-supervised Anomaly Detection and Segmentation in images based on Deep Learning.
278 stars 61 forks source link

AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.activations' has no attribute 'swish' #50

Open cyysky opened 4 years ago

cyysky commented 4 years ago

Just installed follow instruction and run example. Hit error.

(kt) D:\Sample\MVTec-Anomaly-Detection>python train.py -d mvtec/capsule -a mvtecCAE -b 8 -l ssim -c grayscale
2020-10-30 17:31:52.414545: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
  File "train.py", line 11, in <module>
    from autoencoder.autoencoder import AutoEncoder
  File "D:\Sample\MVTec-Anomaly-Detection\autoencoder\autoencoder.py", line 14, in <module>
    import ktrain
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\ktrain\__init__.py", line 2, in <module>
    from . import imports as I
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\ktrain\imports.py", line 219, in <module>
    import transformers
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\transformers\__init__.py", line 135, in <module>
    from .pipelines import (
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\transformers\pipelines.py", line 47, in <module>
    from .modeling_tf_auto import (
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\transformers\modeling_tf_auto.py", line 45, in <module>
    from .modeling_tf_albert import (
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\transformers\modeling_tf_albert.py", line 24, in <module>
    from .activations_tf import get_tf_activation
  File "D:\bin\miniconda3\envs\kt\lib\site-packages\transformers\activations_tf.py", line 53, in <module>
    "swish": tf.keras.activations.swish,
AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.activations' has no attribute 'swish'

(kt) D:\Sample\MVTec-Anomaly-Detection>
simplew2011 commented 4 years ago

update tensorflow to 2.3 version.