MCPcopy
hub / github.com/eriklindernoren/PyTorch-YOLOv3 / print_environment_info

Function print_environment_info

pytorchyolo/utils/utils.py:377–398  ·  view source on GitHub ↗

Prints infos about the environment and the system. This should help when people make issues containg the printout.

()

Source from the content-addressed store, hash-verified

375
376
377def print_environment_info():
378 """
379 Prints infos about the environment and the system.
380 This should help when people make issues containg the printout.
381 """
382
383 print("Environment information:")
384
385 # Print OS information
386 print(f"System: {platform.system()} {platform.release()}")
387
388 # Print poetry package version
389 try:
390 print(f"Current Version: {subprocess.check_output(['poetry', 'version'], stderr=subprocess.DEVNULL).decode('ascii').strip()}")
391 except (subprocess.CalledProcessError, FileNotFoundError):
392 print("Not using the poetry package")
393
394 # Print commit hash if possible
395 try:
396 print(f"Current Commit Hash: {subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], stderr=subprocess.DEVNULL).decode('ascii').strip()}")
397 except (subprocess.CalledProcessError, FileNotFoundError):
398 print("No git or repo found")

Callers 3

runFunction · 0.90
runFunction · 0.90
runFunction · 0.90

Calls

no outgoing calls

Tested by 1

runFunction · 0.72