xmengli / H-DenseUNet

TMI 2018. H-DenseUNet: Hybrid Densely Connected UNet for Liver and Tumor Segmentation from CT Volumes
526 stars 161 forks source link

test.py error #61

Open rz2154181 opened 4 years ago

rz2154181 commented 4 years ago

I am trying to run test.py but I get the error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\custom_layers.py", line 3, in <module>
    from keras.engine import Layer, InputSpec
  File "Keras-2.0.8\keras\__init__.py", line 4, in <module>
    from . import activations
  File "Keras-2.0.8\keras\activations.py", line 6, in <module>
    from .engine import Layer
  File "Keras-2.0.8\keras\engine\__init__.py", line 3, in <module>
    from .topology import InputSpec
  File "Keras-2.0.8\keras\engine\topology.py", line 8, in <module>
    import yaml
  File "Keras-2.0.8\yaml\__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'
xmengli commented 4 years ago

Could you please check the keras version?

goku573 commented 4 years ago

Install version 2.0.8 of keras in your system and comment out sys.path.insert(0, 'Keras-2.0.8') line (line no. 3) from your test.py file

AasiaRehman commented 4 years ago

When I run test.py I am getting these errors what might be the problem? C:\Users\HP\Miniconda3\envs\MedicalImaging\python.exe C:/Users/HP/PycharmProjects/MedicalImaging/H-DenseUNet-master/test.py Using TensorFlow backend. C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) Traceback (most recent call last): File "C:/Users/HP/PycharmProjects/MedicalImaging/H-DenseUNet-master/test.py", line 4, in from keras import backend as K File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\keras__init.py", line 3, in from . import utils File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\keras\utils__init.py", line 6, in from . import conv_utils File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\keras\utils\conv_utils.py", line 3, in from .. import backend as K File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\keras\backend__init.py", line 83, in from .tensorflow_backend import * File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\keras\backend\tensorflow_backend.py", line 1, in import tensorflow as tf File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\init__.py", line 22, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\init.py", line 81, in from tensorflow.python import keras File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\init__.py", line 24, in from tensorflow.python.keras import activations File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\activations.py", line 24, in from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\utils\init.py", line 34, in from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\utils\multi_gpu_utils.py", line 22, in from tensorflow.python.keras.engine.training import Model File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\engine\training.py", line 40, in from tensorflow.python.keras.engine.network import Network File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\engine\network.py", line 38, in from tensorflow.python.keras.engine import saving File "C:\Users\HP\Miniconda3\envs\MedicalImaging\lib\site-packages\tensorflow\python\keras\engine\saving.py", line 44, in import yaml File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\yaml\init__.py", line 8, in from loader import * File "C:\Users\HP\PycharmProjects\MedicalImaging\H-DenseUNet-master\Keras-2.0.8\yaml\loader.py", line 12, in class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): NameError: name 'Parser' is not defined

Hung-Hsiang-617 commented 4 years ago

I am trying to run test.py but I get the error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\custom_layers.py", line 3, in <module>
    from keras.engine import Layer, InputSpec
  File "Keras-2.0.8\keras\__init__.py", line 4, in <module>
    from . import activations
  File "Keras-2.0.8\keras\activations.py", line 6, in <module>
    from .engine import Layer
  File "Keras-2.0.8\keras\engine\__init__.py", line 3, in <module>
    from .topology import InputSpec
  File "Keras-2.0.8\keras\engine\topology.py", line 8, in <module>
    import yaml
  File "Keras-2.0.8\yaml\__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'

Hi. Do you solve the problem? I have the same errors. my tensorflow-gpu version==2.0.0 keras==2.0.8

larry-11 commented 4 years ago

I am trying to run test.py but I get the error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\__init__.py", line 1, in <module>
    from lib import custom_layers
  File "C:\Users\rzara\Desktop\H-DenseUNet-master\lib\custom_layers.py", line 3, in <module>
    from keras.engine import Layer, InputSpec
  File "Keras-2.0.8\keras\__init__.py", line 4, in <module>
    from . import activations
  File "Keras-2.0.8\keras\activations.py", line 6, in <module>
    from .engine import Layer
  File "Keras-2.0.8\keras\engine\__init__.py", line 3, in <module>
    from .topology import InputSpec
  File "Keras-2.0.8\keras\engine\topology.py", line 8, in <module>
    import yaml
  File "Keras-2.0.8\yaml\__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'

Hi. Do you solve the problem? I have the same errors. my tensorflow-gpu version==2.0.0 keras==2.0.8

Use Python 2.7