KugaMaxx / cuke-emlb

A benchmark for event-based denoising.
MIT License
32 stars 4 forks source link

TypeError: accept(): incompatible function arguments. #8

Open shiba24 opened 7 months ago

shiba24 commented 7 months ago

Hi @KugaMaxx , I have been facing this error when I run python3 demo.py:

starting demo, noise sequence length is 1034210
===================================
Model          Length    Runtime   
-----------------------------------
knoise     Traceback (most recent call last):
  File "/home/ubuntu/slocal/cuke-emlb/demo.py", line 67, in <module>
    model.accept(data["events"])
  File "/home/ubuntu/slocal/cuke-emlb/configs/denoisors.py", line 26, in accept
    self.model.accept(events)
TypeError: accept(): incompatible function arguments. The following argument types are supported:
    1. (self: modules.python.khodamoradi_noise.init, events: dv::toolkit::EventStorage) -> None

Invoked with: <modules.python.khodamoradi_noise.init object at 0x7f4ea7c7f930>, Storage containing 1034210 elements within 749994µs duration; time range within [1643505112036837; 1643505112786831]

When i run eval_denoiser.py:

python3 eval_denoisor.py --file ./data/demo/samples/demo-01.aedat4 --denoisor ynoise
TypeError: Unregistered type : dv::AddressableEventStorage<dv::Event, dv::EventPacket>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/slocal/cuke-emlb/eval_denoisor.py", line 36, in <module>
    score = metric.evalEventStorePerNumber(data["events"].toEventStore())
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Unable to convert function return value to a Python type! The signature was
        (self: dv_toolkit.lib._lib_toolkit.EventStorage) -> dv::AddressableEventStorage<dv::Event, dv::EventPacket>

Could you help me on how I can solve this?

Best, Shintaro

KugaMaxx commented 7 months ago

Hi @shiba24, I cannot reproduce your error😞, as the code runs smoothly on my machine. I would appreciate if you could provide more clues.

karaul commented 7 months ago

I have the same error after smooth installation, when I start demo script as adviced in readme.

shiba24 commented 7 months ago

@KugaMaxx I am using venv not conda. But if @karaul uses conda then that should be no problem. I will post my environment details later this week. @karaul could you also share about your environment for this error?

karaul commented 7 months ago

I am working with ubuntu 22 and conda. The old vesrion from July 2023 worked fine. The problem is probably in a new submodule dv-toolikt (yam-toolkit). Later I'll try to check the suspicious submodel independently.

karaul commented 7 months ago

@KugaMaxx please remove commas in readme file (mistype) sudo apt-get install libboost-dev, libopencv-dev, libeigen3-dev, libopenblas-dev

shiba24 commented 7 months ago

Hi @KugaMaxx (and cc @karaul ), my environment is as follows:

Python related:

python 3.11

$ pip3 freeze
contourpy==1.2.0
cycler==0.12.1
dv-processing==1.7.9
dv_toolkit @ file:///home/ubuntu/slocal/cuke-emlb/external/dv-toolkit
fonttools==4.49.0
install==1.3.5
kiwisolver==1.4.5
matplotlib==3.8.3
numpy==1.26.4
packaging==24.0
pillow==10.2.0
plotly==5.20.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
six==1.16.0
tabulate==0.9.0
tenacity==8.2.3
tqdm==4.66.2

dv-related (checked with apt search):

dv-runtime-dev/jammy,now 1.6.2-2~jammy amd64 [installed]
  C++ event-based processing framework for neuromorphic cameras (development files)

dv-processing/jammy,now 1.7.9-1~jammy amd64 [installed]
  Generic algorithms for event cameras (C++ headers).

dv-processing-utilities/jammy,now 1.7.9-1~jammy amd64 [installed,automatic]
  Generic algorithms for event cameras (CLI utilities).

Others:

$ gcc-10 --version
gcc-10 (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++-10 --version
g++-10 (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

$ uname -r
6.5.0-17-generic

I have two questions:

  1. While checking the above, I found out that the following apt package is not installed. Do I need this?
dv-processing-python/jammy 1.7.9-1~jammy amd64
  Generic algorithms for event cameras (Python bindings).
  1. I'm wondering if I installed pybind correctly. Do you know how I can check if the pybind installation is correct?
samiarja commented 5 months ago

Anyone managed to solve this issue? I am also facing the same problem when I run demo.py and eval_denoiser.py

starting demo, noise sequence length is 1034210
===================================
Model          Length    Runtime   
-----------------------------------
knoise Traceback (most recent call last):
  File "/home/sami/cuke-emlb/demo.py", line 68, in <module>
    model.accept(data["events"])
  File "/home/sami/cuke-emlb/configs/denoisors.py", line 26, in accept
    self.model.accept(events)
TypeError: accept(): incompatible function arguments. The following argument types are supported:
    1. (self: modules.python.khodamoradi_noise.init, events: dv::toolkit::EventStorage) -> None

Invoked with: <modules.python.khodamoradi_noise.init object at 0x7efed0e68d30>, Storage containing 1034210 elements within 749994µs duration; time range within [1643505112036837; 1643505112786831]
karaul commented 5 months ago

I have solved the problem in another way specific for my project, and do not know what is a reason.

shiba24 commented 5 months ago

@karaul do you have any idea that worked for you?

karaul commented 5 months ago

One needs carefully check version of packages and their mutual interfere, it's a standard headache in python. My plans were to use this software in on order to analyse noise statistical propereties for https://arxiv.org/abs/2404.01948, but because of technical difficulties of the latest version, I just returned to the earlier version of cuke-emlb published in summer 2023 (see above), that worked fine for me.

Arrokoth0320 commented 2 weeks ago

Unfortunately, I have met the same question. Is seem like the data struct with dv.toolkit can not be used in the mode.chh files. It's very nice for you if the problem solved~

Arrokoth0320 commented 2 days ago

I tried to analyze the source code and wrote test code in C++, and the conclusion I got was that the input should be a match: The data type for Storage containing 1034210 elements within 749994 µ s duration; The data type for time range within [1643505112036837; 1643505112786831] is events: dv:: toolkit:: EventStorage, so I am confused and hope you can provide some help or suggestions.