Open
Description
I'm attempting to load in a Torch model and I'm a little unsure of what RedisAI is expecting It doesn't seem to be documented, so I'm assuming it's the result of torch.save
, but that doesn't seem to work.
As a test, I'm using the AllenNLP tutorial then trying to load one of the models it generates like this:
$ redis-cli -p 9379 -x AI.MODELSET test TORCH CPU < /tmp/model.th
Yet it results in the following error:
ERR: [enforce fail at inline_container.cc:127] . PytorchStreamReader failed reading zip archive: failed finding central directory
frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7fe485ce6021 in /usr/lib/redis/modules/libc10.so)
frame #1: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const&, void const*) + 0x49 (0x7fe485ce5dc9 in /usr/lib/redis/modules/libc10.so)
frame #2: torch::jit::PyTorchStreamReader::valid(char const*) + 0x80 (0x7fe4876cec30 in /usr/lib/redis/modules/libcaffe2.so)
frame #3: torch::jit::PyTorchStreamReader::PyTorchStreamReader(std::string, std::istream*) + 0x1e6 (0x7fe4876d0c36 in /usr/lib/redis/modules/libcaffe2.so)
frame #4: <unknown function> + 0x656543 (0x7fe490329543 in /usr/lib/redis/modules/libtorch.so.1)
frame #5: torch::jit::load(std::istream&, c10::optional<c10::Device>) + 0x7f (0x7fe49032c8cf in /usr/lib/redis/modules/libtorch.so.1)
frame #6: torchLoadModel + 0xeb (0x7fe4975d8ddf in /usr/lib/redis/modules/redisai.so)
frame #7: RAI_ModelCreateTorch + 0x7b (0x7fe4975c812c in /usr/lib/redis/modules/redisai.so)
frame #8: RAI_ModelCreate + 0x83 (0x7fe4975cfb40 in /usr/lib/redis/modules/redisai.so)
frame #9: RedisAI_ModelSet_RedisCommand + 0x52b (0x7fe4975cb8df in /usr/lib/redis/modules/redisai.so)
frame #10: RedisModuleCommandDispatcher + 0x49 (0x561b46ad2ec9 in redis-server *:6379)
frame #11: call + 0xa7 (0x561b46a636a7 in redis-server *:6379)
frame #12: processCommand + 0x35f (0x561b46a63d5f in redis-server *:6379)
frame #13: processInputBuffer + 0x185 (0x561b46a73e35 in redis-server *:6379)
frame #14: aeProcessEvents + 0x2a0 (0x561b46a5d870 in redis-server *:6379)
frame #15: aeMain + 0x2b (0x561b46a5db0b in redis-server *:6379)
frame #16: main + 0x4d3 (0x561b46a5a803 in redis-server *:6379)
frame #17: __libc_start_main + 0xf1 (0x7fe4999e62e1 in /lib/x86_64-linux-gnu/libc.so.6)
frame #18: _start + 0x2a (0x561b46a5aa6a in redis-server *:6379)