【detectron】报错
Traceback (most recent call last):
File "d:/zy/code/DandR/main.py", line 66, in <module>
args = default_argument_parser().parse_args()
File "d:\zy\code\DandR\defrcn\engine\defaults.py", line 66, in default_argument_parser
port = 2 ** 15 + 2 ** 14 + hash(os.getuid()) % 2 ** 14
AttributeError: module 'os' has no attribute 'getuid'
原因
geteuid() is only available on unix like systems. This explains why it doesn't work on Windows.
解决
使用getpass.getuser() 替代 os.getuid()
#port = 2 ** 15 + 2 ** 14 + hash(os.getuid()) % 2 ** 14
import getpass
port = 2 ** 15 + 2 ** 14 + hash(getpass.getuser()) % 2 ** 14
参考
python - AttributeError: module 'os' has no attribute 'geteuid' - Stack Overflow