def initialize_log(file_path, mode='a'):
    """
    Initialize a file in which logs will be written during the execution of 
    training, validation...
    
    Args:
        file_path: string with the path to the file
        mode: default 'a', (if the file exists, it will continue writing logs
            after the last line.). 'w' is also possible if you want to create 
            blank file.
        
        
    Returns:
        _io.TextIOWrapper of the file where logs will be written
        
        
    Raises:
        IOError if the path doesn't exists. 
    """
    try:
        log_file = open(file_path, mode)
        return log_file
    except IOError:
        print('It doesn\'t exit path: ', file_path)
        raise