我将转储尝试 python 脚本时得到的错误代码:
预先处理验证数据
使用 gpu 设备 0:Tesla K20c
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\SciSoft\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\multiprocessing\forking.py", line 380, in main
prepare(preparation_data)
File "C:\SciSoft\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\multiprocessing\forking.py", line 495, in prepare
'__parents_main__', file, path_name, etc
File "C:\Users\Administrator\Desktop\Galaxy Data\kaggle-galaxies-master\kaggle-galaxies-master\try_convnet_cc_multirotflip_3x69r45_maxout2048_extradense.py", line 133, in <module>
for data, length in create_valid_gen():
File "load_data.py", line 572, in buffered_gen_mp
process.start()
`文件“C:\SciSoft\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\multiprocessing\process.py”,第 130 行,在 start self._popen = Popen(self)
文件“C:\SciSoft\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\multiprocessing\forking.py”,第 258 行,在init cmd = get_command_line() + [rhandle]
文件“C:\SciSoft\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\multiprocessing\forking.py”,第 358 行,在 get_command_line` 中
is not going to be frozen to produce a Windows executable.''')
RuntimeError:尝试在当前进程完成其引导阶段之前启动一个新进程。
This probably means that you are on Windows and you have
forgotten to use the proper idiom in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce a Windows executable.
据我了解,我必须插入一行
if __name__ == '__main__':
一些让它工作的地方
谁能告诉我应该在哪个文件中插入它?我已在初始错误日志中包含受影响的文件列表
受影响的文件:
第 131-134 行
和
https://github.com/benanne/kaggle-galaxies/blob/master/load_data.py
第 572 行