pupil-labs / pupil

Open source eye tracking
https://pupil-labs.com
GNU Lesser General Public License v3.0
1.49k stars 679 forks source link

Pupil Player crashes at start of recording on windows10 #2293

Closed KarasawaTakumi0621 closed 1 year ago

KarasawaTakumi0621 commented 1 year ago

Hi, we have a following probrem. With the Windows10 version 21H2. Captures starts up and calibration works normally. However, the following error message appears the moment I try to start recording, and the application stops responding. I am using python 3.8.1 and venv.

[12/12/22 20:53:52] ERROR    Process Capture crashed with trace:                                           world.py:861
                             Traceback (most recent call last):
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\gaze_mapping\no
                             tifications.py", line 48, in from_dict
                                 dict_ = cls.sanitize_serialized_dict(dict_)
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\gaze_mapping\no
                             tifications.py", line 107, in sanitize_serialized_dict
                                 return super().sanitize_serialized_dict(dict_)
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\gaze_mapping\no
                             tifications.py", line 100, in sanitize_serialized_dict
                                 return super().sanitize_serialized_dict(dict_)
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\gaze_mapping\no
                             tifications.py", line 58, in sanitize_serialized_dict
                                 dict_[field_name] = field_cls(dict_[field_name])
                             TypeError: 'ForwardRef' object is not callable

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

                             Traceback (most recent call last):
                               File "C:\Users\tappun\program\pupil\pupil\pupil_src\launchables\world.py",
                             line 743, in world
                                 p.on_notify(n)
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\recorder.py",
                             line 278, in on_notify
                                 self.start()
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\recorder.py",
                             line 390, in start
                                 note = note_class.from_dict(load_object(file_path))
                               File
                             "C:\Users\tappun\program\pupil\pupil\pupil_src\shared_modules\gaze_mapping\no
                             tifications.py", line 51, in from_dict
                                 raise ValueError(f"{err}") from err
                             ValueError: 'ForwardRef' object is not callable

Do you know anything about it? Best wishes.

papr commented 1 year ago

@KarasawaTakumi0621 Hi! Could you let me know which git branch and commit you are using?

papr commented 1 year ago

Closing due to inactivity.

LorenzoFerriniCodes commented 1 year ago

Hi all!

I encountered the same error. I am using python 3.8.10. The error appeared on different branches, including the latest tagged version (3.6).

I checked and it seems that the error originates due to missing handling of ForwardRef objects, that is, using __annotations__. I was able to solve this issue by modifying these lines: https://github.com/pupil-labs/pupil/blob/c309547099099bdff9fac829dc97b546e270d1b6/pupil_src/shared_modules/gaze_mapping/notifications.py#L18-L34 allowing earlier versions to use get_type_hints(), as it has been part of typing since 3.5.

Does anyone know if there's a specific reason for not allowing anything earlier than 3.9 to use get_type_hints() in this case?