Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range
Describe the bug After finding/searching files, the process will freeze at
Running array (
0 => '/var/www/nextcloud/apps/recognize/bin//node',
1 => '/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js',
2 => '-',
)
before the following Error occures
Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097234836
at validateOffset (buffer.js:111:3)
at Function.concat (buffer.js:565:5)
at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26)
at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Promise.all (index 0)
at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) {
code: 'ERR_OUT_OF_RANGE'
}
Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097234836
at validateOffset (buffer.js:111:3)
at Function.concat (buffer.js:565:5)
at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26)
at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Promise.all (index 0)
at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) {
code: 'ERR_OUT_OF_RANGE'
}
Failed to classify images
Classifier process error
To Reproduce
Steps to reproduce the behavior:
- Go to shell
- run /occ recognize:classify-images
- Wait for processing
- See error
Expected behavior Tagging all images
Recognize (please complete the following information):
- Tensorflow plain mode: JavaScript mode enabled
- Enabled modes: face, object, landmark
Server (please complete the following information):
- Nextcloud: [e.g. 21.0.4]
- 4 GB RAM on Rasberry Pi 4 ( Linux 5.10.92)
- PHP 8.0
Which version of recognize is this?
Off, this seems to be some limitation of the download library for download sizes more than 1GiB :/
same error here on pi4, nextcloud 23.0.2, Apache/2.4.38, PHP 7.3.31-1~deb10u1, Recognize 1.11.0 cli, run classify command results in error:
/occ recognize:classify-images 10711 => '/var/data/admin/files/Video/Wyjazd.Integracyjny 2011 DVDRip.XviD-BiDA FILM POLSKI Upload zaloga TC/GIf....png', ) Running array ( 0 => '/var/www/nextcloud/apps/recognize/bin//node', 1 => '/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js', 2 => '-', ) 0
Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097235711 at validateOffset (buffer.js:111:3) at Function.concat (buffer.js:565:5) at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26) at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23 at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Promise.all (index 0) at async exports.downloadAll (/var/www/nextcloud/apps/recognize/src/model-manager.js:8:2) at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) { code: 'ERR_OUT_OF_RANGE' }
Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097235711 at validateOffset (buffer.js:111:3) at Function.concat (buffer.js:565:5) at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26) at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23 at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Promise.all (index 0) at async exports.downloadAll (/var/www/nextcloud/apps/recognize/src/model-manager.js:8:2) at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) { code: 'ERR_OUT_OF_RANGE' }
Failed to classify images
@marcelklehr Should we use another library then? I don't know if that's already the "recommended" one, but I see the download parent library that we use hasn't been updated for quite a few years
same error, want to stay updated
In the mean time.
A temporary workaround is to manually download the library : wget https://github.com/marcelklehr/recognize/archive/refs/tags/v2.2.1.tar.gz (the number is the version number in the package.json file)
Extract the files and copy or link to the "models" folder
In v3 you can now download models using an occ command, which should be a simple workaround.