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

"org.bytedeco.javacv.FrameRecorder$Exception: No video output stream" while running ALE.java example #4749

Closed
anis016 opened this issue Mar 1, 2018 · 14 comments
Labels
Bug Bugs and problems

Comments

@anis016
Copy link

anis016 commented Mar 1, 2018

@saudet

Hello ! I am trying to run ALE.java in org.deeplearning4j.examples.rl4j package .. but, getting this error. Please check the gist !

https://gist.github.com/anis016/6e5a49cc40776a410bb15d7fa0d09bf4

Moreover, please share with me the correct ROM file for "pong.bin". Getting an warning given below.

Game console created:
ROM file: pong.bin
Cart Name: Video Olympics (1978) (Atari)
Cart MD5: 60e0ea3cbe0913d39803477945e9e5ec
Display Format: AUTO-DETECT ==> NTSC
ROM Size: 2048
Bankswitch Type: AUTO-DETECT ==> 2K

WARNING: Possibly unsupported ROM: mismatched MD5.
Cartridge_MD5: 60e0ea3cbe0913d39803477945e9e5ec
Cartridge_name: Video Olympics (1978) (Atari)

@saudet
Copy link
Contributor

saudet commented Mar 2, 2018

That looks like the right bin. What do you get running the sample code on the following page?
https://github.com/bytedeco/javacpp-presets/tree/master/ale#sample-usage

@saudet saudet self-assigned this Mar 2, 2018
@anis016
Copy link
Author

anis016 commented Mar 2, 2018

I ran the sample code in the link, and this is working fine ! I can see the GUI window (ALE Viz) where the "pong" is played and also I could see the printing of the episodes...

======================================================================
A.L.E: Arcade Learning Environment (version 0.6.0)
[Powered by Stella]
Use -help for help screen.
Warning: couldn't load settings file: ./ale.cfg
Game console created:
ROM file: /home/anis/Java_Workspace/SharedLibraryInterface/src/main/resources/pong.bin
Cart Name: Video Olympics (1978) (Atari)
Cart MD5: 60e0ea3cbe0913d39803477945e9e5ec
Display Format: AUTO-DETECT ==> NTSC
ROM Size: 2048
Bankswitch Type: AUTO-DETECT ==> 2K

Screen Display Active. [Manual Control Mode] 'm' [Slowdown] 'a' [Speedup] 's' [VolumeDown] '[' [VolumeUp] ']'.

WARNING: Possibly unsupported ROM: mismatched MD5.
Cartridge_MD5: 60e0ea3cbe0913d39803477945e9e5ec
Cartridge_name: Video Olympics (1978) (Atari)

Running ROM file...
Random seed is 123
Episode 0 ended with score: -21.0
Episode 1 ended with score: -21.0
Episode 2 ended with score: -20.0
Episode 3 ended with score: -21.0
.
.

@saudet
Copy link
Contributor

saudet commented Mar 3, 2018

Ok, good!

There's been a couple of things fixed since DL4J 0.9.1 though, so could you try with 0.9.2-SNAPSHOT and let me know if this still happens? Thanks!

@anis016
Copy link
Author

anis016 commented Mar 8, 2018

Hello @saudet !
It took a while to build everything from scratch...

  1. I built in this way for 0.9.2-SNAPSHOT: https://gist.github.com/anis016/0f9c759e57dd641cd18e67516475dbed

  2. I created a new module "rl4jexample" in the "rl4j" and copied the ALE.java in here. Pom: https://gist.github.com/anis016/f70e5a3e61d2c7ba38f72fe602d0957e

  3. The error: https://gist.github.com/anis016/81c216265526a7fea1f613741fdd2211

Please advise further !

@saudet
Copy link
Contributor

saudet commented Mar 9, 2018

Ah, you didn't have to build everything from scratch, binaries are available here:
https://deeplearning4j.org/snapshots

In any case, thanks for the log! It makes it clear the issue is this:

[libx264 @ 0x7f2f09132580] [Eval @ 0x7f2f11e71bf0] Invalid chars '.0' at the end of expression '30.0'
[libx264 @ 0x7f2f09132580] Unable to parse option value "30.0"
[libx264 @ 0x7f2f09132580] Error setting option crf to value 30.0.
org.bytedeco.javacv.FrameRecorder$Exception: avcodec_open2() error -22: Could not open video codec.

Looks like an issue with JavaCV. I should be able to fix this today...

@saudet saudet added the Bug Bugs and problems label Mar 9, 2018
@saudet
Copy link
Contributor

saudet commented Mar 9, 2018

Actually, I'm unable to reproduce this issue. "crf" is a float value, and setting something like "10.5" works just fine on my machine. Could you try to run the following test and let me know what happens?
https://github.com/bytedeco/javacv/blob/master/platform/src/test/java/org/bytedeco/javacv/FrameGrabberTest.java#L266

@anis016
Copy link
Author

anis016 commented Mar 15, 2018

Hello @saudet
Sorry for the late reply. I am only able to run dl4j, when I have access to a faster PC. However,

  1. I am not able to run the Testcase you mentioned. I have added the screenshot. There's several symbols it can't find. Please check and advice.
    scree

  2. Previously you mentioned, "you didn't have to build everything from scratch, binaries are available here: https://deeplearning4j.org/snapshots" I was not able to figure it out properly to run the 0.9.2 snapshot. could you please share with me a pom file ? or maybe a small project where ALE.java is running ? as I actually need to run only "org.deeplearning4j.examples.rl4j" package "ALE.java" ! And, since, it has no problem in your machine, I guess somewhere I am doing a bit wrong.

Thank you

@saudet
Copy link
Contributor

saudet commented Mar 15, 2018

You can find a sample pom.xml file for 0.9.2-SNAPSHOT on this branch:
https://github.com/deeplearning4j/dl4j-examples/tree/sa_snapshot

It looks like your IDE has trouble loading artifacts from the snapshot server though, that's why JavaCV isn't working there. You'll need to figure out why that is...

@anis016
Copy link
Author

anis016 commented Mar 17, 2018

hello @saudet

there's some update... now I am getting this error after trying in another PC... please have a look. we tried in the master branch.

12:55:18.204 [main] ERROR org.deeplearning4j.rl4j.learning.sync.SyncLearning - Training failed.
java.lang.RuntimeException: Non-existent compression algorithm requested: [FLOAT]
	at org.nd4j.linalg.compression.BasicNDArrayCompressor.decompressi(BasicNDArrayCompressor.java:250)
	at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.validateDataType(DefaultOpExecutioner.java:541)
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:680)
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:119)
	at org.nd4j.linalg.api.ndarray.BaseNDArray.assign(BaseNDArray.java:1274)
	at org.nd4j.linalg.api.ndarray.BaseNDArray.put(BaseNDArray.java:2297)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscrete.setTarget(QLearningDiscrete.java:200)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscrete.trainStep(QLearningDiscrete.java:162)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.QLearning.trainEpoch(QLearning.java:93)
	at org.deeplearning4j.rl4j.learning.sync.SyncLearning.train(SyncLearning.java:38)
	at com.packt.JavaDL.ReinforcmentLearning.ALE.main(ALE.java:66)
java.lang.RuntimeException: Non-existent compression algorithm requested: [FLOAT]
	at org.nd4j.linalg.compression.BasicNDArrayCompressor.decompressi(BasicNDArrayCompressor.java:250)
	at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.validateDataType(DefaultOpExecutioner.java:541)
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:680)
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:119)
	at org.nd4j.linalg.api.ndarray.BaseNDArray.assign(BaseNDArray.java:1274)
	at org.nd4j.linalg.api.ndarray.BaseNDArray.put(BaseNDArray.java:2297)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscrete.setTarget(QLearningDiscrete.java:200)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscrete.trainStep(QLearningDiscrete.java:162)
	at org.deeplearning4j.rl4j.learning.sync.qlearning.QLearning.trainEpoch(QLearning.java:93)
	at org.deeplearning4j.rl4j.learning.sync.SyncLearning.train(SyncLearning.java:38)
	at com.packt.JavaDL.ReinforcmentLearning.ALE.main(ALE.java:66)

gist: https://gist.github.com/rezacsedu/46281a884179c17123516e8114e058cd

@saudet
Copy link
Contributor

saudet commented Mar 28, 2018

@raver119 I'm also getting that stack trace on my machine. Do you know what changed with respect to the compression algorithms?

@raver119
Copy link
Contributor

Nothing changed AFAIK, but i'm seeing the same issue in nd4j-tests, so i'm going to check & fix that once i'm done with cnn gradients problem.

@saudet
Copy link
Contributor

saudet commented Mar 28, 2018

ok, so it is an issue with compression, good to know!

@saudet
Copy link
Contributor

saudet commented Apr 4, 2018

Confirmed fixed, thanks to @raver119!

@saudet saudet closed this as completed Apr 4, 2018
@lock
Copy link

lock bot commented Sep 22, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Bugs and problems
Projects
None yet
Development

No branches or pull requests

3 participants