Skip to content

Update flexynesis to 1.1.7#1797

Draft
nilchia wants to merge 38 commits intobgruening:masterfrom
nilchia:update_flexynesis
Draft

Update flexynesis to 1.1.7#1797
nilchia wants to merge 38 commits intobgruening:masterfrom
nilchia:update_flexynesis

Conversation

@nilchia
Copy link
Collaborator

@nilchia nilchia commented Mar 9, 2026

FOR CONTRIBUTOR:

  • I have read the CONTRIBUTING.md document and this tool is appropriate for the tools-iuc repo.
  • License permits unrestricted use (educational + commercial)
  • This PR adds a new tool or tool collection
  • This PR updates an existing tool or tool collection
  • This PR does something else (explain below)

There are two labels that allow to ignore specific (false positive) tool linter errors:

  • skip-version-check: Use it if only a subset of the tools has been updated in a suite.
  • skip-url-check: Use it if github CI sees 403 errors, but the URLs work.

@nilchia
Copy link
Collaborator Author

nilchia commented Mar 13, 2026

the inference works for regression and classification tasks.

the error for crossmodality is this:

Job in error state.. tool_id: flexynesis_infer, exit_code: 1, stderr: /usr/local/lib/python3.13/site-packages/geomloss/samples_loss.py:58: SyntaxWarning: invalid escape sequence '\i'
/usr/local/lib/python3.13/site-packages/geomloss/kernel_samples.py:5: SyntaxWarning: invalid escape sequence '\s'
Traceback (most recent call last):
  File "/home/nilchia/Documents/github/bgruening/galaxytools/tools/flexynesis/convert_safetensors_pth.py", line 239, in <module>
    model = reconstruct_model(
        safetensors_path=args.safetensors,
        config_path=args.config,
        artifacts_path=args.artifacts,
    )
  File "/home/nilchia/Documents/github/bgruening/galaxytools/tools/flexynesis/convert_safetensors_pth.py", line 210, in reconstruct_model
    model.load_state_dict(state_dict)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/torch/nn/modules/module.py", line 2635, in load_state_dict
    raise RuntimeError(
    ...<3 lines>...
    )
RuntimeError: Error(s) in loading state_dict for CrossModalPred:
	Missing key(s) in state_dict: "decoders.1.hidden_layers.0.weight", "decoders.1.hidden_layers.0.bias", "decoders.1.hidden_layers.2.weight", "decoders.1.hidden_layers.2.bias", "decoders.1.hidden_layers.2.running_mean", "decoders.1.hidden_layers.2.running_var", "decoders.1.FC_output.weight", "decoders.1.FC_output.bias". 
.

The errro for unsupervised is this:

Job in error state.. tool_id: flexynesis_infer, exit_code: 1, stderr: /usr/local/lib/python3.13/site-packages/geomloss/samples_loss.py:58: SyntaxWarning: invalid escape sequence '\i'
/usr/local/lib/python3.13/site-packages/geomloss/kernel_samples.py:5: SyntaxWarning: invalid escape sequence '\s'
/usr/local/lib/python3.13/site-packages/geomloss/samples_loss.py:58: SyntaxWarning: invalid escape sequence '\i'
/usr/local/lib/python3.13/site-packages/geomloss/kernel_samples.py:5: SyntaxWarning: invalid escape sequence '\s'
Traceback (most recent call last):
  File "/usr/local/bin/flexynesis", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/local/lib/python3.13/site-packages/flexynesis/__main__.py", line 485, in main
    model = torch.load(args.pretrained_model, map_location=device, weights_only=True)
  File "/usr/local/lib/python3.13/site-packages/torch/serialization.py", line 1548, in load
    raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, �[1mdo those steps only if you trust the source of the checkpoint�[0m. 
	(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
	(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
	WeightsUnpickler error: Unsupported global: GLOBAL flexynesis.models.supervised_vae.supervised_vae was not an allowed global by default. Please use `torch.serialization.add_safe_globals([flexynesis.models.supervised_vae.supervised_vae])` or the `torch.serialization.safe_globals([flexynesis.models.supervised_vae.supervised_vae])` context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

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

Successfully merging this pull request may close these issues.

2 participants