xamyzhao / brainstorm

Implementation of "Data augmentation using learned transforms for one-shot medical image segmentation"
MIT License
392 stars 91 forks source link

AttributeError: module 'src.utils' has no attribute 'concatenate_with_pad' #9

Closed aven1995 closed 4 years ago

aven1995 commented 5 years ago

Hi, Thank you for sharing the code. I run

python main.py seg --gpu 0 --data mri-100unlabeled --aug_sas

has a error message:

Traceback (most recent call last):
  File "main.py", line 367, in <module>
    test_every_n_epochs=test_every_n_epochs)
  File "/home/aven/Research/brainstorm-master/src/experiment_engine.py", line 121, in run_experiment
    exp.create_generators(batch_size=run_args.batch_size)
  File "/home/aven/Research/brainstorm-master/src/segmenter_model.py", line 252, in create_generators
    self._create_augmented_examples()
  File "/home/aven/Research/brainstorm-master/src/segmenter_model.py", line 496, in _create_augmented_examples
    aug_im = utils.concatenate_with_pad([
AttributeError: module 'src.utils' has no attribute 'concatenate_with_pad'

After reading the code,u don,t have definition concatenate_with_pad in src/utils.py. Is it your code have problem? or something wrong i have? I try my best to ask in English.Hope u can know what i mean.

My enviroment is:

OS: Ubuntu 16.04 x86_64
Python version: Python 3.6.8 :: Anaconda, Inc.
tensorflow-gpu version: 1.9.0
Keras version: 2.1.6
xamyzhao commented 5 years ago

@aven1995 thanks for pointing this out! You are right -- I forgot to include that function. I will push a fix -- in the meantime, feel free to comment that part of the code out, or edit the code (the function simply pads all of the images to the same size so that they can be concatenated with one another).