Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run predict: doesn't seem to load peak detection parameters from pickle anymore #10

Open
yeswecan opened this issue Apr 7, 2024 · 0 comments

Comments

@yeswecan
Copy link

yeswecan commented Apr 7, 2024

Here's the error inside dill:

Exception has occurred: TypeError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
a bytes-like object is required, not '_io.BytesIO'
  File "/home/k4/Projects/JingleGenerator/UnsupSeg/.venv/lib/python3.10/site-packages/dill/_dill.py", line 302, in loads
    file = StringIO(str)
  File "/home/k4/Projects/JingleGenerator/UnsupSeg/predict.py", line 23, in main
    peak_detection_params = dill.loads(io.BytesIO(ckpt['peak_detection_params']))['cpc_1']
  File "/home/k4/Projects/JingleGenerator/UnsupSeg/predict.py", line 55, in <module>
    main(args.wav, args.ckpt, args.prominence)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,
TypeError: a bytes-like object is required, not '_io.BytesIO'

Caused by the line

peak_detection_params = dill.loads(io.BytesIO(ckpt['peak_detection_params']))['cpc_1']

I think I got somewhere further fixing this by adding .read to io.BytesIO(ckpt['peak_detection_params']), but it still gives a different error unpickling the same file. Maybe the version of something has changed, but I tried both setting it up via requirements and changing versions of some of the components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant