Open swathiraon opened 4 years ago
Have you found a solution? I used the sample dataset from /samples/test/sample.csv
, but have not figured it out yet
Have you found a solution?
Has a solution been found to this issue?
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
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