SimCenter Forum
Artificial Intelligence in Natural Hazards Engineering [Archived] => AI use in Regional Simulation (BRAILS) => Topic started by: Niko Grisel Todorov on February 24, 2023, 12:49:05 AM
-
While running InventoryGenerator.generate(attributes='all')
with location='Gaziantep, TR'
I get a FacadeParser.py:145, at minLineIdx = int(np.argmin(xp)/2), where apparently xp is an empty sequence, with the following complete error trace:
Determining the heights and roof pitch for each building...
Default facade parser model at tmp/models/facadeParser.pth loaded
24%|██▍ | 48/200 [57:51<3:03:13, 72.33s/it]
Traceback (most recent call last):
File "C:\GitHub\NHERI-GSC-MC-team1\code\startup.py", line 12, in <module>
invGenerator.generate(attributes='all')
File "C:\Python310\lib\site-packages\brails\InventoryGenerator.py", line 334, in generate
facadeParserModel.predict(image_handler,storyModel)
File "C:\Python310\lib\site-packages\brails\modules\FacadeParser\FacadeParser.py", line 368, in predict
roof_run = compute_roofrun(footprint)
File "C:\Python310\lib\site-packages\brails\modules\FacadeParser\FacadeParser.py", line 145, in compute_roofrun
minLineIdx = int(np.argmin(xp)/2)
File "<__array_function__ internals>", line 180, in argmin
File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 1312, in argmin
return _wrapfunc(a, 'argmin', axis=axis, out=out, **kwds)
File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
ValueError: attempt to get argmin of an empty sequence
Process finished with exit code 1
Any chance you can test for xp prior to the argmin(); or at least catch the exception more gracefully? Thank you in advance for your prompt response!
NGT
-
Hi Niko,
Thank you for using the SimCenter Forum, and apologies that this message escaped our attention until today.
Something about this image seems to trigger an error with the way FacadeParser computes the roof run. For easier troubleshooting, any chance you could share the latitude/longitude of the building location that results in this error?
Thank you
-
You can add a check to ensure 'xp' is not empty before calling np.argmin(). Here's how you could do it in Python:
if len(xp) > 0:
minLineIdx = int(np.argmin(xp)/2)
else:
# Handle the case when 'xp' is empty
# For example, set minLineIdx to a default value or raise a specific exception
fnf (https://fnf2.io/)
-
geometry dash bloodbath (https://geometrydashbloodbath.com)
You can add a check to ensure 'xp' is not empty before calling np.argmin(). Here's how you could do it in Python:
if len(xp) > 0:
minLineIdx = int(np.argmin(xp)/2)
else:
# Handle the case when 'xp' is empty
# For example, set minLineIdx to a default value or raise a specific exception
Still failing to follow instructions. It seems like some step is not correct
-
five nights at freddy's 4 (https://fivenightsatfreddys4.com)
Hi Niko,
Thank you for using the SimCenter Forum, and apologies that this message escaped our attention until today.
Something about this image seems to trigger an error with the way FacadeParser computes the roof run. For easier troubleshooting, any chance you could share the latitude/longitude of the building location that results in this error?
Thank you
I'm also interested in this information but it still hasn't been answered
-
Thank you all for your interest in BRAILS. The latest version of BRAILS fully addresses this issue.
If you have any further questions or comments, please let me know.