zhutmost / lsq-net

Unofficial implementation of LSQ-Net, a neural network quantization framework
MIT License
276 stars 40 forks source link

run error #9

Closed 15757170756 closed 3 years ago

15757170756 commented 3 years ago
INFO - Log file for this run: F:\GitHub_Repository\lsq-net-master\out\MyProject_20210110-155852\MyProject_20210110-155852.log
INFO - TensorBoard data directory: F:\GitHub_Repository\lsq-net-master\out\MyProject_20210110-155852/tb_runs
INFO - Dataset `cifar10` size:
          Training Set = 47500 (743)
        Validation Set = 2500 (40)
              Test Set = 10000 (157)
INFO - Created `resnet20` model for `cifar10` dataset
          Use pre-trained model = True
Traceback (most recent call last):
  File "F:/GitHub_Repository/lsq-net-master/main.py", line 120, in <module>
    main()
  File "F:/GitHub_Repository/lsq-net-master/main.py", line 58, in main
    tbmonitor.writer.add_graph(model, input_to_model=train_loader.dataset[0][0].unsqueeze(0))
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\utils\tensorboard\writer.py", line 534, in add_graph
    self._get_file_writer().add_graph(graph(model, input_to_model, verbose, **kwargs))
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\utils\tensorboard\_pytorch_graph.py", line 276, in graph
    trace, _ = torch.jit.get_trace_graph(model, args)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\jit\__init__.py", line 231, in get_trace_graph
    return LegacyTracedModule(f, _force_outplace, return_inputs)(*args, **kwargs)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\jit\__init__.py", line 294, in forward
    out = self.inner(*trace_inputs)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 491, in __call__
    result = self._slow_forward(*input, **kwargs)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 481, in _slow_forward
    result = self.forward(*input, **kwargs)
  File "F:\GitHub_Repository\lsq-net-master\model\resnet_cifar.py", line 121, in forward
    out = F.relu(self.bn1(self.conv1(x)))
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 491, in __call__
    result = self._slow_forward(*input, **kwargs)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 481, in _slow_forward
    result = self.forward(*input, **kwargs)
  File "F:\GitHub_Repository\lsq-net-master\quan\func.py", line 26, in forward
    return self._conv_forward(quantized_act, quantized_weight)
  File "C:\Anaconda3_Python3.6_x64\lib\site-packages\torch\nn\modules\module.py", line 539, in __getattr__
    type(self).__name__, name))
AttributeError: 'QuanConv2d' object has no attribute '_conv_forward'

Process finished with exit code 1
zhutmost commented 3 years ago

Looks that it is a bug caused by a incompatible PyTorch version. It would be helpful if you can list your Conda environment.

zhutmost commented 3 years ago

Since this issue is inactive for a long time, close it.