Xilinx / brevitas

Brevitas: neural network quantization in PyTorch
https://xilinx.github.io/brevitas/
Other
1.2k stars 197 forks source link

When evaluating BNN model, 'object has no attribute round_ste' #207

Closed dustinjoe closed 4 years ago

dustinjoe commented 4 years ago

When I try to run the pretrained models of BNN using the command run into error shown as below: PYTORCH_JIT=1 brevitas_bnn_pynq_train --evaluate --network CNV_1W1A --pretrained

RuntimeError: object has no attribute round_ste: File "/home/xyzhou/anaconda3/lib/python3.7/site-packages/brevitas/function/ops_ste.py", line 68

"""
return torch.ops.brevitas.round_ste(x)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

Any suggestion on this? Thank you!

volcacius commented 4 years ago

Hello,

  1. Which version of pytorch are you using?
  2. Have you properly installed the package (either cd /path/to/brevitas && pip install . or cd /path/to/brevitas && pip install -e .)?

That function is generated during the installation and possibly (depending on the version of pytorch) dispatched to a binary backend.

Alessandro

dustinjoe commented 4 years ago

Oh, thank you for your fast reply! I did not know it is a generated function~ I indeed just changed my Pytorch from CPU version to GPU version. Just removed and reinstalled Brevitas and it is working now. Thank you!