You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update the get_weights_list to only read a single line from the best_model.txt file.
defget_weights_list(self, model_choice: str="ENSEMBLE") ->List[str]:
"""Returns a list of the model weights files (.h5) within the weights directory. Args: model_choice (str, optional): The type of model weights to return. Valid choices are 'ENSEMBLE' (default) to return all available weights files or 'BEST' to return only the best model weights file. Returns: list: A list of strings representing the file paths to the model weights files in the weights directory. Raises: FileNotFoundError: If the BEST_MODEL.txt file is not found in the weights directory. """ifmodel_choice=="ENSEMBLE":
weights_list=glob(os.path.join(self.weights_directory, "*.h5"))
returnweights_listelifmodel_choice=="BEST":
# read model name (fullmodel.h5) from BEST_MODEL.txtwithopen(os.path.join(self.weights_directory, "BEST_MODEL.txt")) asf:
model_name=f.readline()
# remove any leading or trailing whitespace and newline charactersmodel_name=model_name.strip()
weights_list= [os.path.join(self.weights_directory, model_name)]
returnweights_list
The text was updated successfully, but these errors were encountered:
update the get_weights_list to only read a single line from the best_model.txt file.
The text was updated successfully, but these errors were encountered: