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

Outdated libs need configuration #14

Open
jonasboh opened this issue Jul 6, 2023 · 0 comments
Open

Outdated libs need configuration #14

jonasboh opened this issue Jul 6, 2023 · 0 comments

Comments

@jonasboh
Copy link

jonasboh commented Jul 6, 2023

I needed to adjust the code as the code installed by pip leads to very much lib downgrading of scikit learn I tried to go with WORC from the githab repository.

I needed to fix bugs regarding the newer numpy version where in the code older parts of numpy have been used.
Configured: WORC/processing/label_processing.py
All np.float replaced by float

Libs:
numpy 1.25.0
sklearn 1.2.2
imblearn 0.10.1

Anyhow I am getting the following error after executing the experiments:
Exception: A blackhole to another dimenstion has opened. This exception should never be thrown. Double check your code or make an issue on the WORC github so that we can fix this issue.

Hope that this error can be fixed and this tool can be used.

Best,
Jonas

The total output looks like:
SimpleV validated: True.
MinSubjectsV validated: True.
Sample validated: True.
EvaluateV validated: True.
Label_type given is None, extracting all labels.
Label names to extract: Index(['imaginary_label_1', 'imaginary_label_2', 'Hospital', 'Age',
'complement_label_1'],
dtype='object')
InvalidLabelsV validated: True.
Debug detected: False.
Building training network...
[WARNING] basemanager:0303 >> Cannot scan /home/j902n/anaconda3/envs/Predict/lib/python3.9/site-packages/WORC/resources/fastr_tools with ToolManager, path does not exist!
[WARNING] basemanager:0327 >> Could not load file /home/j902n/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/resources/tools/fastr/flow/1.0/crossvalidation.yaml: 'tuple' object has no attribute 'values'

AttributeError Traceback (most recent call last)
File ~/Desktop/E240-ML/projects/Predict/WORC/test/WORCTutorial/WORC/facade/simpleworc.py:64, in _error_bulldozer..dec(*args, **kwargs)
63 try:
---> 64 func(*args, **kwargs)
65 except Exception as e:

File ~/Desktop/E240-ML/projects/Predict/WORC/test/WORCTutorial/WORC/facade/basicworc.py:168, in BasicWORC.execute(self)
166 self._worc.configs[cnum]['ImageFeatures']['image_type'] = self._image_types[cnum]
--> 168 self._worc.build()
169 if self._add_evaluation:

File ~/Desktop/E240-ML/projects/Predict/WORC/test/WORCTutorial/WORC/WORC.py:548, in WORC.build(self, wtype)
547 if wtype == 'training':
--> 548 self.build_training()
549 elif wtype == 'testing':

File ~/Desktop/E240-ML/projects/Predict/WORC/test/WORCTutorial/WORC/WORC.py:584, in WORC.build_training(self)
583 # Create config source
--> 584 self.source_class_config = self.network.create_source('ParameterFile', id='config_classification_source', node_group='conf', step_id='general_sources')
586 # Classification tool and label source

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/api/init.py:576, in Network.create_source(self, datatype, id, step_id, resources, node_group)
575 resources = resources or ResourceLimit()
--> 576 return Node(self.parent.create_source(
577 datatype=datatype,
578 id_=id,
579 stepid=step_id,
580 resources=resources.copy(),
581 nodegroup=node_group
582 ))

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/planning/network.py:558, in Network.create_source(self, datatype, id_, stepid, resources, nodegroup)
557 resources = resources or ResourceLimit()
--> 558 source_node = SourceNode(datatype=datatype, id_=id_, parent=self, resource_limits=resources, nodegroup=nodegroup)
559 self.add_node(source_node)

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/planning/node.py:1153, in SourceNode.init(self, datatype, id_, parent, resource_limits, nodegroup)
1135 """
1136 Instantiation of the SourceNode.
1137
(...)
1151 >>> source = network.create_source(datatype=types['ITKImageFile'], id_='sourceN')
1152 """
-> 1153 tool = resources.tools['fastr/Source:1.0', '1.0']
1155 super(SourceNode, self).init(tool, id_, parent=parent, resource_limits=resource_limits, nodegroup=nodegroup)

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/plugins/managers/objectmanager.py:65, in ObjectManager.getitem(self, key)
64 new_key = self.keytransform(key)
---> 65 if new_key not in self.data:
66 raise exceptions.FastrObjectUnknownError('Key "{}" (expanded to {}) not found in {}'.format(key, new_key, type(self).name))

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:64, in BaseManager.data(self)
61 """
62 The actual data dict underlying this Manager
63 """
---> 64 self.ensure_loaded()
65 return self._data

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:72, in BaseManager.ensure_loaded(self)
71 if self._data is None:
---> 72 self.populate()

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/plugins/managers/toolmanager.py:28, in ToolManager.populate(self)
27 def populate(self):
---> 28 super().populate()
29 IOPluginManager.create_ioplugin_tool(self, interfaces=resources.interfaces)

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:82, in BaseManager.populate(self)
81 if self._path[0] is not None:
---> 82 self._scan_directory(self._path[0], recursive=self._path[1])

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:300, in BaseManager._scan_directory(self, path, recursive, namespace)
299 for entry in path:
--> 300 self._scan_directory(entry, recursive)
301 else:

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:317, in BaseManager._scan_directory(self, path, recursive, namespace)
316 if recursive:
--> 317 self._scan_directory(filepath, recursive, namespace + (filename,))
318 elif os.path.isfile(filepath) and self.match_filename(filename):

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:317, in BaseManager._scan_directory(self, path, recursive, namespace)
316 if recursive:
--> 317 self._scan_directory(filepath, recursive, namespace + (filename,))
318 elif os.path.isfile(filepath) and self.match_filename(filename):

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:317, in BaseManager._scan_directory(self, path, recursive, namespace)
316 if recursive:
--> 317 self._scan_directory(filepath, recursive, namespace + (filename,))
318 elif os.path.isfile(filepath) and self.match_filename(filename):

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/basemanager.py:325, in BaseManager._scan_directory(self, path, recursive, namespace)
324 try:
--> 325 self._load_item(filepath, namespace=namespace)
326 except Exception as exception:

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/plugins/managers/objectmanager.py:146, in ObjectManager._load_item(self, filepath, namespace)
142 """
143 Load a Object file and store it in the Manager
144 """
--> 146 obj = load(filepath, cls=self.object_class)
147 object_version = self.get_object_version(obj)

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/serializable.py:387, in load(path, method, cls)
384 if hasattr(cls, 'dataschemafile'):
385 # We just check if dataschemafile existed, but pylint missed that
386 # pylint: disable=no-member
--> 387 data = cls.get_serializer().instantiate(data)
389 # Instantiate object

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/abc/serializable.py:278, in Serializable.get_serializer(cls, filename)
277 try:
--> 278 cls.SERIALIZERS[filename] = jsonschemaparser.getblueprinter(filename)
279 except IOError as err:

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/helpers/jsonschemaparser.py:569, in getblueprinter(uri, blueprint)
568 validator = jsonschema.validators.validator_for(blueprint)
--> 569 blueprinter = extend(validator)(uri, blueprint)
570 return blueprinter

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/helpers/jsonschemaparser.py:474, in extend..Blueprinter.init(self, uri, schema, types, resolver, format_checker)
473 if resolver is None:
--> 474 resolver = FastrRefResolver(uri, schema)
476 if format_checker is None:

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/fastr/helpers/jsonschemaparser.py:62, in FastrRefResolver.init(self, base_uri, referrer, store, cache_remote, handlers)
61 default_handlers.update(handlers)
---> 62 super(FastrRefResolver, self).init(base_uri, referrer, store, cache_remote, default_handlers)

File ~/anaconda3/envs/Predict/lib/python3.9/site-packages/jsonschema/validators.py:748, in RefResolver.init(self, base_uri, referrer, store, cache_remote, handlers, urljoin_cache, remote_cache)
745 self.store.update(store)
746 self.store.update(
747 (schema["$id"], schema)
--> 748 for schema in store.values()
749 if isinstance(schema, Mapping) and "$id" in schema
750 )
751 self.store[base_uri] = referrer

AttributeError: 'tuple' object has no attribute 'values'

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[5], line 2
1 # Run the experiment!
----> 2 experiment.execute()

File ~/Desktop/E240-ML/projects/Predict/WORC/test/WORCTutorial/WORC/facade/simpleworc.py:67, in _error_bulldozer..dec(*args, **kwargs)
65 except Exception as e:
66 if e.class not in _valid_exceptions:
---> 67 raise unexpected_exception_exception
68 raise e

Exception: A blackhole to another dimenstion has opened. This exception should never be thrown. Double check your code or make an issue on the WORC github so that we can fix this issue.

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

1 participant