Geoyi/pixel-decoder

requirements.txt is broken

chelm opened this issue · 4 comments

chelm commented

It looks like some stdout/stderr got logged to the requirement.txt file, so we're unable to install the needed deps.

Great project btw!

Geoyi commented

@chelm, pretty cool that you tried it out and filed the first issue ever on this repo. I fixed the dependencies on requirement.txt, do you want to give another try?

Hello,

Thanks for sharing your project!

I still got conflict versions with the update of requirements.txt
Here are the bugs I met:

  • Conflicting versions of decorator

    pkg_resources.ContextualVersionConflict: (decorator 4.1.2 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('decorator>=4.3.0'), {'networkx'})
    

    fixed by upgrading decorator to 4.3.0 and changing the corresponding line in requirements.txt

  • Missing packages

    ModuleNotFoundError: No module named 'tensorflow'
    

    and

    ModuleNotFoundError: No module named 'cv2'
    

    so I installed tensorflow and opencv-python

  • I was using Keras 2.2.2 but

    from keras.applications.imagenet_utils import _obtain_input_shape
    ImportError: cannot import name '_obtain_input_shape'
    

    I turned keras.applications.imagenet_utils to keras_applications.imagenet_utils, it seems to do the trick.
    There are also conflicts with tensorflow 1.11.0:

    keras 2.2.2 has requirement keras-applications==1.0.4, but you'll have keras-applications 1.0.5 which is incompatible.
    keras 2.2.2 has requirement keras-preprocessing==1.0.2, but you'll have keras-preprocessing 1.0.3 which is incompatible.
    

    So I downgraded tensorflow to version 1.10.0

I was then able to start the training. But I got another error then... I'm not sure if it's from the changes I made or something else. It happens when it will start the 1st epoch training. Here is the complete error, tell me whether it worth opening a new issue:

Traceback (most recent call last):
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/bin/pixel_decoder", line 11, in <module>
    load_entry_point('pixel-decoder', 'console_scripts', 'pixel_decoder')()
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/pixel_decoder/main.py", line 75, in cli
    main(args.pop('command'), **args)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/pixel_decoder/main.py", line 56, in main
    train(**kwargs)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/pixel_decoder/train.py", line 70, in train
    callbacks=[model_checkpoint])
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/engine/training.py", line 1415, in fit_generator
    initial_epoch=initial_epoch)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/engine/training_generator.py", line 213, in fit_generator
    class_weight=class_weight)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/engine/training.py", line 1215, in train_on_batch
    outputs = self.train_function(ins)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2666, in __call__
    return self._call(inputs)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2636, in _call
    fetched = self._callable_fn(*array_vals)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1382, in __call__
    run_metadata_ptr)
  File "/home/pauline/Documents/POCteledetection/pixel-decoder/venv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [786432] vs. [262144]
         [[Node: metrics/dice_coef/mul = Mul[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](metrics/dice_coef/Reshape, metrics/dice_coef/Reshape_1)]]

Geoyi commented

@paumillet, thanks for posting the issue.
Can you make a pull request to the requirement.txt on what you've installed for tensorflow and opencv-python?
The error you got was from the label data, and you may want to look into another issue, I posted a solution there. Hope that is helpful if you keep getting error, let me know.

Thank you @Geoyi, it solved my problem!