thomaskuestner / CNNArt

Automatic and reference-free MR artifact detection
Apache License 2.0
25 stars 17 forks source link

format probelm of patchSize #9

Closed TokenJan closed 6 years ago

TokenJan commented 6 years ago

Hi, I'm new to this group. However, when I try to run the main.py with the default param.yml configuration. Following error occurs:

Traceback (most recent call last):
  File "/home/d1242/no_backup/d1242/CNNArt/main.py", line 35, in <module>
    sOutPath = cfg['selectedDatabase']['pathout'] + os.sep + ''.join(patchSize).replace(" ", "") + os.sep + sOutsubdir # + str(ind_split) + '_' + str(patchSize[0]) + str(patchSize[1]) + '.h5'
TypeError: sequence item 0: expected string, int found

I think that is because patchSize is defined as [40, 40] in param.yml by default and 40 is parsed as int instead of string - which is not allowed in python.

It could be easily solved by changing ''.join(patchSize).replace(" ", "") to str(patchSize[0]) + str(patchSize[1]).

I'm using Python 2.7 by the way, could anyone please take a look at this code or correct me if I make a mistake

thomaskuestner commented 6 years ago

Thanks, solved with ab086c37d9b290b143d5be52adaa7de699dab87d