IST-DASLab / OBC

Code for the NeurIPS 2022 paper "Optimal Brain Compression: A Framework for Accurate Post-Training Quantization and Pruning".
https://arxiv.org/abs/2208.11580
105 stars 14 forks source link

IndexError: index -10219 is out of bounds for axis 0 with size 10001 when running spdy.py for mixed quantization 2:4 #7

Open chensy7 opened 1 year ago

chensy7 commented 1 year ago

Hello, thanks for open-sourcing the great work!

I'm following the example on the main README for Mixed quantization + 2:4 pruning. I can run until python spdy.py rn18 imagenet 8 mixed --dp without any problems, but running the DP step throws an error:

Traceback (most recent call last):
  File "spdy.py", line 240, in <module>
    print(get_score(np.ones(len(layers))))
  File "spdy.py", line 204, in get_score
    solution = dp(costs)
  File "spdy.py", line 182, in dp
    solution.append(PD[layer][timing])
IndexError: index -10219 is out of bounds for axis 0 with size 10001

The only changes I made were changing the path to imagenet and commenting out lines 233-248 in database.py. Is this a version incompatibility issue? Any help is appreciated!

frankinwi commented 12 months ago

@chensy7 Same problem. I noticed that the source code of SPDY (ICML 2022) is different from that provided in this repo. Can the authors provide more instructions on how to debug this error?