File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2254,6 +2254,11 @@ def diagnose(
22542254 cmd , capture_output = True , check = False , text = True
22552255 )
22562256 if proc .returncode :
2257+ get_logger ().error (
2258+ "'diagnose' command failed!\n stdout:%s\n stderr:%s" ,
2259+ proc .stdout ,
2260+ proc .stderr ,
2261+ )
22572262 if require_gradients_ok :
22582263 raise RuntimeError (
22592264 "The difference between autodiff and finite difference "
@@ -2268,8 +2273,13 @@ def diagnose(
22682273 )
22692274
22702275 # Read the text and get the last chunk separated by a single # char.
2271- with open (output ) as handle :
2272- text = handle .read ()
2276+ try :
2277+ with open (output ) as handle :
2278+ text = handle .read ()
2279+ except FileNotFoundError as exc :
2280+ raise RuntimeError (
2281+ "Output of 'diagnose' command does not exist."
2282+ ) from exc
22732283 * _ , table = re .split (r"#\s*\n" , text )
22742284 table = (
22752285 re .sub (r"^#\s*" , "" , table , flags = re .M )
You can’t perform that action at this time.
0 commit comments