kulikovv / dognet

A Deep Architecture for Synapse Detection in Multiplexed Fluorescence Images
GNU General Public License v3.0
14 stars 4 forks source link

Error when running run_collman.py etc. #2

Closed jgallowa07 closed 4 years ago

jgallowa07 commented 5 years ago

Hi there!

I'm looking to run some examples of dognet and eventually train with some of our own confocal imaging data, however, after installing all dependecies and attempting to run the examples run_collman.py etc. I get the error

jovyan@5ba12b469501:~/Bi410/dognettest/dognet/run$ python3 run_weiler.py 
training on collman15 dataset
CUDA is not detected, running on CPU
Traceback (most recent call last):
  File "run_weiler.py", line 70, in <module>
    net,errors =dognet.train_routine(n,dognet.create_generator(train_images,train_labels),n_iter=3000,margin=3)
  File "../dognet/training.py", line 163, in train_routine
    device = detector.parameters().next().device
AttributeError: 'generator' object has no attribute 'next'

Any thoughts on where I'm going wrong?

kulikovvictor commented 5 years ago

Hello!

In python3 the next method of the generator has been removed in the flavor of next() or you can just call next. Replace that line of code with: device = next(detector.parameters()).device Hope it will help.

jgallowa07 commented 4 years ago

Oops, I should have thought about that, thank you!