fab-jul/L3C-PyTorch

Error while decompressing

JonnyGov opened this issue · 4 comments

decoding using:

python l3c.py logdir 0306_0001 dec out.l3c decoded.png

The following exception appears :

ValueError: buffer is smaller than requested size

(full trace below)

  • installed torchac for CPU
  • when encoding i used :
python l3c.py logdir 0306_0001 enc imgdir/val_oi_500_r/0a7f13330a5d0023.png  out.l3c

full trace :

Traceback (most recent call last):
  File "l3c.py", line 129, in <module>
    main()
  File "l3c.py", line 123, in main
    tester.decode(flags.img_p, flags.out_p_png)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/test/multiscale_tester.py", line 405, in decode
    decoded = self.bc.decode(pin)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 153, in decode
    bn_prev = self.decode_scale(dmll, l, fin)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 264, in decode_scale
    bn, _ = self.code_with_cdf(l, (1, C, H, W), decoder, dmll)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 291, in code_with_cdf
    decoded_bn[:, c, ...], extra_info_c = bn_coder(c, C_cond_cur)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 254, in decoder
    num_bytes = read_num_bytes_encoded(fin)
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 352, in read_num_bytes_encoded
    return int(read_bytes(fin, [np.uint32])[0])
  File "/home/yonathan/anaconda3/envs/l3c_env/lib/python3.7/site-packages/fjcommon/functools_ext.py", line 32, in composed
    return f1(f2(*args_c, **kwargs_c))
  File "/home/yonathan/Documents/GitHub/L3C-PyTorch/src/bitcoding/bitcoding.py", line 375, in read_bytes
    yield np.frombuffer(f.read(num_bytes_to_read), t, count=1)
ValueError: buffer is smaller than requested size

compression was not done fully due to a lack of ram
increasing it solved the issue.

Hi, I'm looking for val_oi_500_r, which was deleted from ETH and I have no access anymore. It seems you had it in March, do you still have it? :)

Thanks a bunch, that's awesome!