05dirnbe / nefi

Network Extraction From Images
BSD 2-Clause "Simplified" License
34 stars 14 forks source link

thinning.py conflicts with thinning module #35

Closed tastyminerals closed 8 years ago

tastyminerals commented 8 years ago

Updated to the latest version and ran a pipeline on a sample image.

Failed to process pipeline
Traceback (most recent call last):
  File "/home/tastyminerals/dev/nefi_rem/nefi/nefi2/view/main_controller.py", line 1883, in run
    self.pipeline.process()
  File "/home/tastyminerals/dev/nefi_rem/nefi/nefi2/model/pipeline.py", line 297, in process
    cat.process(data)
  File "/home/tastyminerals/dev/nefi_rem/nefi/nefi2/model/categories/_category.py", line 136, in process
    selected_alg.process(args)
  File "nefi2/model/algorithms/thinning.py", line 50, in process
    skeleton = thinning.guo_hall_thinning(args[0].copy())
AttributeError: module 'thinning' has no attribute 'guo_hall_thinning'
Current cat <segmentation.CatBody object at 0x7fbbda5fd6a0>
phreic commented 8 years ago

Does it always happen to you? I couldn't reproduce this error. Which pipeline did you use?

tastyminerals commented 8 years ago

This is strange because it should be happening on your machine too.

Careful, importing thinning.py breaks thinning module. You need to rename thinning.py into something different to fix this issue. Imported file thinning.py shadows thinning module.

phreic commented 8 years ago

It doesn't break anything on my machine. Neither on Windows nor on Linux but I can rename this algorithm anyway.

tastyminerals commented 8 years ago

Are you sure you have the latest version from git? Well this is what exactly happening on my machine, thinning module is shadowed by instantiated thinning.py which does not have guo_hall_thinning function.

phreic commented 8 years ago

Yes, I'm using the latest commit from master branch and everything is working for me. So, renaming thinning.py into something different solves the problem for you? In order to prevent other people run into this problem we should just rename it.