Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Niko Grisel Todorov

Pages: [1]
1
ValueError: zero-size array to reduction operation minimum which has no identity

Another ValueError run-time error, quite possibly due to Google StreetMap not returning an image in a timely manner; stopped on 2123 out of 10000 requested.

location = 'Gaziantep, TR' 
invGenerator = InventoryGenerator(
    location=location, nbldgs=10000, randomSelection=True,
    GoogleAPIKey="")
invGenerator.generate(attributes=['erabuilt','garage','numstories','buildingheight'])

Can you please catch this (ImHandler.py, line 427) exception with skipping the building instead of crashing?

Here is the full error trace:

Searching for Gaziantep, TR...
Found Gaziantep, Güneydoğu Anadolu Bölgesi, Türkiye

Fetching footprint data for Gaziantep...
Found a total of 302286 building footprints in Gaziantep
Randomly selected 10000 buildings
Found an entry in attributes that was not enabled in InventoryGenerator.
Ignoring entry: occupancy
Traceback (most recent call last):
  File "C:\GitHub\NHERI-GSC-MC-team1\code\startup.py", line 14, in <module>
    # invGenerator.generate(attributes=['occupancy', 'erabuilt', 'garage', 'numstories', 'buildingheight'])
  File "C:\Python310\lib\site-packages\brails\InventoryGenerator.py", line 208, in generate
    image_handler.GetGoogleStreetImage(footprints)
  File "C:\Python310\lib\site-packages\brails\workflow\ImHandler.py", line 697, in GetGoogleStreetImage
    refLine, imagePlane, scale, fov, heading = image_retrieve(fp,'tmp/images/street',count,self.apikey)
  File "C:\Python310\lib\site-packages\brails\workflow\ImHandler.py", line 671, in image_retrieve
    premRefLine = compute_refline(footprint,p1,visibleLineSeg) 
  File "C:\Python310\lib\site-packages\brails\workflow\ImHandler.py", line 427, in compute_refline
    lineFrontal = linesKeep[np.where(linesKeepDist==np.min(linesKeepDist))[0].item(0),:]
  File "<__array_function__ internals>", line 180, in amin
  File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 2918, in amin
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
  File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

ValueError: zero-size array to reduction operation minimum which has no identity

Process finished with exit code 1

2
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

Pages: [1]