Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_pickle.UnpicklingError: could not find MARK #12

Open
swathiraon opened this issue Mar 5, 2020 · 4 comments
Open

_pickle.UnpicklingError: could not find MARK #12

swathiraon opened this issue Mar 5, 2020 · 4 comments

Comments

@swathiraon
Copy link

File "evalue.py", line 121, in
total_time, results, savedscore = get_score(data_source, files, args.thres, args.missing_option)
File "evalue.py", line 74, in get_score
tmp_data = read_pkl(f)
File "C:\anomalydetector-master\anomalydetector-master\srcnn\utils.py", line 47, in read_pkl
def read_pkl(path):
with open(path, 'rb') as f:
return pickle.load(f)#this is where it throws error

@dan-r95
Copy link

dan-r95 commented May 20, 2020

Have you found a solution? I used the sample dataset from /samples/test/sample.csv, but have not figured it out yet

@Fayeben
Copy link

Fayeben commented Apr 30, 2021

Have you found a solution?

@tarnjotbains
Copy link

Has a solution been found to this issue?

@StCross
Copy link

StCross commented Oct 6, 2021

I dont know why the authors use pickle to read data, but my method works well by changing pickle to pandas.
here are my codes in evalue.py, get_score func:

def get_score(data_source, files, thres, option):
    total_time = 0
    results = []
    savedscore = []
    for f in files:
        print('reading', f)
        data = pd.read_csv(f)
        in_timestamp, in_value, in_label = data['timestamp'].values, data['value'].values, data['label'].values
        length = len(in_timestamp)
        if model == 'sr_cnn' and len(in_value) < window:
            print("length is shorter than win_size", len(in_value), window)
            continue
        time_start = time.time()
        timestamp, label, pre, scores = models[model](in_timestamp, in_value, in_label, window, net, option, thres)
        time_end = time.time()
        total_time += time_end - time_start
        results.append([timestamp, label, pre, f])
        savedscore.append([label, scores, f, timestamp])
    return total_time, results, savedscore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants