想跑通第1个参考资料上讲的例子,一定要注意gcc和gperftools的版本.因为LibTorch用了c++17的over-aligned新特性.
centos默认的gcc是4.8.5不支持这个新特性,直接用会一直报Attempt to free invalid pointer 0xxxxxx Aborted

  • OS centos 7.5
  • gcc 7.3.1
  • gperftools 2.7
  • LibTorch 1.1

参考资料

相关文章: