NREL / Panel-Segmentation

This open-source package provides a framework for automatically detecting and extracting metadata from solar array installations in satellite images.
https://panel-segmentation.readthedocs.io
MIT License
21 stars 5 forks source link

Add gh actions pytest workflow #3

Closed kandersolar closed 3 years ago

kandersolar commented 3 years ago

Follow-up to #2, but opening it from a branch inside this repo instead of from my fork.

kandersolar commented 3 years ago

@kperrynrel the CI gets through the installation successfully now, but it hits a fatal error when running the test suite (example). Looks like this is where the error occurs: https://github.com/NREL/Panel-Segmentation/blob/kanderso-nrel-patch-1/panel_segmentation/panel_train.py#L217-L222

I can try to figure it out, but maybe you've seen this before? A couple possibilities off the top of my head:

kandersolar commented 3 years ago

@kperrynrel are those h5 files stored in LFS? If so, they might not get pulled by default, see the lfs config here: https://github.com/actions/checkout#usage

kperrynrel commented 3 years ago

They are stored via lfs. Thanks for sending this to me--I'll check if that's what's affecting it

kandersolar commented 3 years ago

Speculation for fixing the segfault: specify workers=0 to the call to custom_model.fit(...) in TrainPanelSegmentationModel.trainSegmentation? I wouldn't be surprised if there was something non-thread-safe in here, and per the docs: " If 0, will execute the generator on the main thread. "

kperrynrel commented 3 years ago

@kanderso so I think you may be right. In running the tests individually I'm getting an error where the globalmaxpoolinglayer2d , and associated keras model is persisting across functions when it shouldn't be. May be because that main thread is persisting. Will give that a shot and see if we can get it up and working.