Hi, I’ve been having an issue with a Lightgbm model. The training works but I get an error importing lightgbm during inference.
########## Generating Predictions on /data/mse_debug_data.csv #############
Traceback (most recent call last):
File “predict.py”, line 20, in
from utils import *
File “/home/aicrowd/utils.py”, line 1, in
from global_imports import *
File “/home/aicrowd/global_imports.py”, line 5, in
import lightgbm as lgb
File “/usr/local/lib/python3.8/site-packages/lightgbm/init.py”, line 8, in
from .basic import Booster, Dataset
File “/usr/local/lib/python3.8/site-packages/lightgbm/basic.py”, line 43, in
_LIB = _load_lib()
File “/usr/local/lib/python3.8/site-packages/lightgbm/basic.py”, line 34, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File “/usr/local/lib/python3.8/ctypes/init.py”, line 451, in LoadLibrary
return self._dlltype(name)
File “/usr/local/lib/python3.8/ctypes/init.py”, line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: libgomp.so.1: cannot open shared object file: No such file or directory
I keep getting Inference error messages, even thought my notebook codes works correctly. Can you help me figure out what is going on? Submission # 118475
Yes I see what is going on. I think you may be using one of the notebook versions from the early weeks of the game. We made a small change to the load_model function by making sure it requires no arguments.
In your case the fix is easy, can you please replace your load_model function with this?
load_model <- function(){
# Load a saved trained model from the file `trained_model.RData`.
# This is called by the server to evaluate your submission on hidden data.
# Only modify this *if* you modified save_model.
load('trained_model.RData')
return(model)
}
I can generate prices using your submission with the following change