laurenok24 commited on
Commit
7f19091
·
verified ·
1 Parent(s): 186c955

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -25,8 +25,16 @@ import base64
25
  template_path = 'report_template_tables.html'
26
  dive_data = {}
27
 
28
- with open('./segmentation_error_data.pkl', 'rb') as f:
29
- dive_data_precomputed = pickle.load(f)
 
 
 
 
 
 
 
 
30
 
31
  import sys
32
  import csv
 
25
  template_path = 'report_template_tables.html'
26
  dive_data = {}
27
 
28
+ class CPU_Unpickler(pickle.Unpickler):
29
+ def find_class(self, module, name):
30
+ if module == 'torch.storage' and name == '_load_from_bytes':
31
+ return lambda b: torch.load(io.BytesIO(b), map_location='cpu')
32
+ else: return super().find_class(module, name)
33
+
34
+ dive_data_precomputed = CPU_Unpickler(open('./segmentation_error_data.pkl', 'rb')).load()
35
+
36
+ # with open('./segmentation_error_data.pkl', 'rb') as f:
37
+ # dive_data_precomputed = pickle.load(f)
38
 
39
  import sys
40
  import csv