Category : pickle

The case is as follows: I have stored several pickles of my machine learning models in a google bucket. At inference time i simply use the command minio_obj.fget_object(bucket, object_name=element.object_name, file_path=path), which simply works for 99 out of 100 different pickled files. The one time that this doesn’t work the download simply hangs and timeouts. The ..

Read more

I have a python class representing grouped Dicom series from a particular subject, defined in a module dicom_parser.py. When instantiated, the class calls methods which read and sort Dicoms via UID. import os import pydicom as pdi class DicomSeries(): def __init__(self): self._dcm_unsort_headers = self._dicom_parse("/home/hamilton/dicoms/XYZ_fmri_2011") self.grouped_dcm = self._dicom_sort(self._dcm_unsort_headers) delattr(self, "_dcm_unsort_headers") @staticmethod def _dicom_parse(dcm_dir): # Find and ..

Read more

I have some files with models serialized with pickle, but now when i try to unserialize them, i get: UserWarning: Trying to unpickle estimator LogisticRegression from version 1.0.1 when using version 1.0.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to: https://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations How can ..

Read more

I’m Getting:- loss: 0.4413 – accuracy: 0.8617 – val_loss: 0.7057 – val_accuracy: 0.8038 Code: import numpy as np import pandas as pd from tensorflow.keras.preprocessing.image import ImageDataGenerator import os import random import cv2 import imutils import random import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import LabelBinarizer from keras.utils import np_utils from tensorflow.keras.models import ..

Read more

Well i get this error in my code that uses multiprocessing, so whenever i click the button a thread is started that reads that from input fields and start working with it including an image path that i read from code directory, could that be the problem ? Button: button_lunch = Button(root, text=’Lunch’, command=threading.Thread(target=post).start) Button ..

Read more

I have already implemented a programm, where it gets a path with hundreds of pdf-files. It than opens them and extracts informations. But this takes a while, so i wanted to implement the ProcessPoolExecutor. import concurrent.futures import os def func(path): print(path) return path path = r’C:Usersabi52OneDriveDesktopPyprogrammeSDBS’ listPaths= os.listdir(PfadOrdner) listPathsFinal = [] if __name__ == ‘__main__’: ..

Read more