Python 如何修复对旧代码版本的回溯?
我在Jupyter笔记本中运行代码,它会将错误追溯到较旧的文件版本(实际文件中不再包含错误代码) 我更新了ipython,尝试重新启动Jupyter,重新打开(以前是erroneuos)文件,重新启动了整个计算机。什么都不管用 这是回溯错误:Python 如何修复对旧代码版本的回溯?,python,git,jupyter-notebook,traceback,Python,Git,Jupyter Notebook,Traceback,我在Jupyter笔记本中运行代码,它会将错误追溯到较旧的文件版本(实际文件中不再包含错误代码) 我更新了ipython,尝试重新启动Jupyter,重新打开(以前是erroneuos)文件,重新启动了整个计算机。什么都不管用 这是回溯错误: TypeError Traceback (most recent call last) <ipython-input-34-b46c17b92e93> in batchGener
TypeError Traceback (most recent call last)
<ipython-input-34-b46c17b92e93> in batchGenerator(self, DG_list, batch_size, output_format)
233 batches = []
234 for DG in DG_list:
--> 235 batches.append(DG.generate(batchIDs,output_format))
236 yield tuple(batches) # match output type to keras fit_generator generator function
237
~\PycharmProjects\MMOP\ADT\DataGeneratorADT.py in generate(self, IDList, outputFormat)
222 if header != self._DUF_columns:
223 warnings.warn('The DUF header is not consistent with the DG setting. It is now set to:',
--> 224 header)
225 self._DUF_columns = header
226 list_reader = list(reader)
TypeError: category must be a Warning subclass, not 'list'
相关代码行:
由于我删除了警告并用打印替换了它,因此我希望必须对警告进行错误处理。似乎有两个问题导致了此错误:
gitgc
。上面的命令删除临时文件和不必要的文件。(垃圾收集器)if header != self._DUF_columns:
print('The DUF header is not consistent with the DG setting. It is now set to:' + header)
self._DUF_columns = header