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

problem loading model file: /usr/local/share/model/vmaf_float_v0.6.1.pkl #24

Open
bryankanderson opened this issue Dec 14, 2020 · 9 comments

Comments

@bryankanderson
Copy link

I have tried running this on Linux, MacOS, and Windows, with various different source files, but all of them end with the following error after analyzing the files:

problem loading model file: /usr/local/share/model/vmaf_float_v0.6.1.pkl
[Parsed_libvmaf_4 @ 0x56271c705080] libvmaf encountered an error, check log for details
Error while filtering: Invalid argument
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0

Conversion failed!

@cpw7922
Copy link

cpw7922 commented Dec 22, 2020

I seem to be having the same issue

libvmaf WARNING could not read model from path: "/usr/local/share/model/vmaf_float_v0.6.1.pkl"
libvmaf WARNING pkl model files have been deprecated, use json
libvmaf ERROR problem loading model file: /usr/local/share/model/vmaf_float_v0.6.1.pkl

[Parsed_libvmaf_4 @ 0x556104075980] libvmaf encountered an error, check log for details
Error while filtering: Invalid argument
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0

Conversion failed!

Traceback (most recent call last):
  File "/home/chris/Documents/Docker/videobench/videobench.py", line 223, in <module>
    data_json = json.load(open("{0}quality_{1}.json".format( tmp_path , input_obj.name)))
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/videobench/quality_BR_RIP_NAS.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/chris/Documents/Docker/videobench/videobench.py", line 225, in <module>
    with open("{0}quality_{1}.json".format( tmp_path , input_obj.name), 'r') as file : #################### replace nan by 0
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/videobench/quality_BR_RIP_NAS.json'

@bryankanderson
Copy link
Author

Due to lack of response, I tried using FFMPEG with libvmaf compiled in, actually got a similar error "Invalid argument" when invoking libvmaf. Ended up needing to massage the command string feeding to libvmaf as it is very sensitive to quote, double-quote, escaping, etc. After a lot of trial an error, I finally got it to work, so its probably something with the command that is invoking libvmaf is not formatted/escaped correctly.

@cpw7922
Copy link

cpw7922 commented Dec 22, 2020

Glad to hear you got it to work. Can you share what the final command string that worked is?

@bryankanderson
Copy link
Author

when using ffmpeg, the command for libvmaf was:

libvmaf="model_path=c:\:/ffmpeg-4.2.1/bin/vmaf_v0.6.1.pkl":log_path=VMAF_results.txt -report -f null -

This was on a Windows box with ffmpeg installed under C:. No docker was used, so not 100% sure how to translate this into this project.

@marcelpoelstra
Copy link

Please see #27
This will fix the issue

@cpw7922
Copy link

cpw7922 commented Jan 5, 2021

It seems like that fixed the issue but I am still having trouble getting the analysis to complete. The Docker file does appear to build and run without issues. When I look at the log from the docker container while the analysis is running it appears to work but I am still getting this at the end

edit: I also do not have vmaf_float_v0.6.1.pkl in /usr/local/share/model/ but I do have vmaf_v0.6.1.pkl and vmaf_4k_v0.6.1.pkl

* Analyzing Reference File...

-> BR_RIP.mp4 
 Bitrate  : 29.97 Mbps
 avg_framerate : 24.0
 interlaced : 0 

* Analyzing tests Files...

-> CM_NVENC_Trim.mp4 
 Bitrate : 9.69 Mbps
 avg_framerate : 24.0
 interlaced : 0 

* Quality measures...

-> CM_NVENC_Trim.mp4 
 Reference deint_filter : null
 VMAF Model : /usr/local/share/model/vmaf_float_v0.6.1.pkl
 Scale filter : scale=1920:1080:flags=neighbor
 Quality Subsampling : 1
 Calculate VMAF & PSNR (libvmaf)


libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version

libvmaf WARNING could not read model from path: "/usr/local/share/model/vmaf_float_v0.6.1.pkl"
libvmaf WARNING pkl model files have been deprecated, use json
frame=   24 fps=0.0 q=-0.0 size=N/A time=00:00:01.24 bitrate=N/A speed=2.46x    

Traceback (most recent call last):
  File "/home/xxxx/Documents/Docker/videobench/videobench.py", line 223, in <module>
    data_json = json.load(open("{0}quality_{1}.json".format( tmp_path , input_obj.name)))
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/videobench/quality_CM_NVENC_Trim.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxxx/Documents/Docker/videobench/videobench.py", line 225, in <module>
    with open("{0}quality_{1}.json".format( tmp_path , input_obj.name), 'r') as file : #################### replace nan by 0
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/videobench/quality_CM_NVENC_Trim.json'

@marcelpoelstra
Copy link

The issue is clearly stated in the output :
"libvmaf WARNING could not read model from path: "/usr/local/share/model/vmaf_float_v0.6.1.pkl"

This means that you did not do all the changes. Did you check-out my fork or did you do the changes manually?
In any case, you need to rebuild the Docker container using the --no-cache option the first time after the changes, otherwise the model files do not get copied. This is one of the issues with the latest VMAF libraries, that 'make install' does no longer copy the model files. For that reason I included a forced move of these files in the Dockerfile
Another thing is, your setup is apparently still using the depricated .pkl model files, while my changes are including the json model files instead.
I think the best thing would be to clean out everything, so delete the videobench directory, and clear out the related docker leftovers like the built image, and check out my fork of this repostory and use that to start over.

@cpw7922
Copy link

cpw7922 commented Jan 5, 2021

Sorry, didn't notice that you created a fork. Deleted everything and I downloaded your repo this time and it appears to be working. Thanks for the help!

@bryankanderson
Copy link
Author

This fixed it for me, but please know that there are still a few things that need to be changed in order to run this under Windows, as noted here:
#17 (comment)

Not saying you need to fix this in code, but adding it to the ReadMe would be helpful.

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

3 participants