-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
now how to pass Tensor or data dir path to ChunkDataReader in Javacpp-pytorch #1556
Comments
There's some sample code here: |
Very thanks , these ChunkDataLoader and ChunkDataset could use ChunkDataReader , but for these JavaDataset also need pass org.bytedeco.javacpp.Pointer object, and should also pass some DataReader object? but now javacpp-pytorch only have ChunkDataReader ,so what should we pass to these JavaDataLoader JavaDataset, I also think maybe should pass InputStream** but It not is Pointer subclass. |
I don't know what JavaDataset is for. @HGuillemet ? |
|
how to use these javaDataset, please show me one use case,thanks |
Just subclass it: JavaDataset ds = new JavaDataset() {
@Override public Example get(long idx) {
// ...
}
@Override public SizeTOptional size() {
// ...
}
}; Then use it for instance with a random sampler and a random loader: DataLoaderOptions opts = new DataLoaderOptions(2);
opts.workers().put(5);
JavaRandomDataLoader loader = new JavaRandomDataLoader(ds, new RandomSampler(ds.size().get()), opts); |
thanks. but I do not see how to pass data dir path or tensor param to the javadataset , need me implement javadataset ,and use difined how to pass ? |
Hi :
![image](https://private-user-images.githubusercontent.com/6143404/398740935-1cdbb507-6478-42fc-ae99-57f2b3b67c91.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTcwMjQsIm5iZiI6MTczOTYxNjcyNCwicGF0aCI6Ii82MTQzNDA0LzM5ODc0MDkzNS0xY2RiYjUwNy02NDc4LTQyZmMtYWU5OS01N2YyYjNiNjdjOTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTA1MjA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Zjk1ZWQwOTBhODQ2NWEyZGQwNTdiZTE0MWQwNjQ0YjZlZjUyYzU0ODczMzM5YmMyZjU3YmI0NTg0MWU4YjM0OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.5KCqkXXHI77DcV4kXxpFfcPHg_MHmLx7U3kaXZSDrwI)
now we have write some code to extend storch framework https://github.com/sbrunk/storch make pytorch in scala env, so will rewrite the dataset dataloader simpler and dataReader, now javacpp-pytorch only have ChunkDataReader ,but I not know how to pass data chunk path or tensor Example to ChunkDataReader ,could you give me one example to show how to use it .@h @saudet . by the way @sbrunk If you know thank tell me ,
The text was updated successfully, but these errors were encountered: