一些经常忘记的报错

文章目录

      • sklearn库安装
      • time.clock()报错

sklearn库安装

sklearn库的标准名字——scikit-learn

pip install scikit-learn

time.clock()报错

Traceback (most recent call last):
File “/home/hsilab/Data/wk/HyperAE-master/demo.py”, line 82, in
time_start = time.clock()
AttributeError: module ‘time’ has no attribute ‘clock’

原因是 Python3.8 不再支持time.clock,但在调用时,非本工程文件CBTaggingDecoder依然包含该方法。
修改方法:将time.clock 改成 time.perf_counter(),功能不变,如下图170行、171行所示。

time_start = time.perf_counter()

你可能感兴趣的:(学习记录,python)