Hello! 
I downloaded a section of image with my ROI from Google Earth Engine as .tif image and converted it to .kea with python gdal.translate() command.
Then I successfully segmented it with shepherd segmentation and prepared a .shp with training polygons, which I rasterized to KEA with gdal_rasterize. All my .kea products open correctly in TuiView.
Problem arises when I try to call populateRATwithStats function. The Python kernel just simply gives me a prompt, that it died and restarts. I don't get any more info when I run a script in Spyder and in Anaconda prompt when the code run as Jupyter notebook.
I am on Windows 10, I make sure to run Conda as administrator, have it installed for all users and the problem remains regardless of whether I work in C or D drive. 
How do I make sure all RSGISLib functions work correctly?
Regards
Julian
The code below:
# Hand-coded paths to images for testing
multibandPathTif = os.path.join(sentinelDownloadFolder,'S2_L1_20190203.tif')
multibandPath = os.path.join(sentinelDownloadFolder,'S2_L1_20190203.kea')
clumpsImagePath = os.path.join(segmentationsFolder,'S2_L1_20190203_segm.kea')
# Convert multiband to KEA
tifInput = gdal.Open(multibandPathTif)
formatName = 'KEA'
driver = gdal.GetDriverByName(formatName)
multibandKeaDS = driver.CreateCopy(multibandPath,tifInput,0)
del tifInput
del multibandKeaDS
print('Image converted to KEA')
#==# PREPARE FOR CLASSIFICATION: INPUTS ARE MULTIBAND PATH, .KEA WITH SEGMENTS AND .KEA WITH TRAINING DATA
bandNames = ['Blue','Green','Red','NIR']
trainingPolysFile = r'S2_L1_20190203_classTraining.kea'
classImagePath = os.path.join(trainingFolder,trainingPolysFile)
# Populate with all statistics (min, max, mean, standard deviation)
# Build statistics
bandinfo = []
numBands = len(bandNames) # As many as there are bands
for i in range(numBands):
    bandName = bandNames[i]
    bandinfo.append(rsgislib.rastergis.BandAttStats(band=i, minField=bandName+'Min', maxField=bandName+'Max', meanField=bandName+'Mean', stdDevField=bandName+'Stdev'))
print('Variables for training defined')
# Populate for each clump
rsgislib.rastergis.populateRATWithStats(multibandPath, clumpsImagePath, bandinfo) # HERE IS WHERE THE KERNEL DIES
print('Clumps populated with variables')