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

TypeError: '>=' not supported between instances of 'NoneType' and 'int' #46

Open
hjcxlp opened this issue Feb 15, 2025 · 3 comments
Open

Comments

@hjcxlp
Copy link

hjcxlp commented Feb 15, 2025

pls advise how to solve

Traceback (most recent call last):
File "E:\program\YuEGP\venv\lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

@deepbeepmeep
Copy link
Owner

Please provide the full stack of errors

@brcisna
Copy link

brcisna commented Feb 18, 2025

I am getting the same message using rocm HIP with AMD gpu

Alternatively if you have an AMD GPU please do the following (many thanks to Hackey for sharing these install instructions):

pip3 install torch torchaudio triton --index-url https://download.pytorch.org/whl/rocm6.2
TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python gradio_server.py --profile 1 --sdpa
Then install dependencies with the following command:

pip install -r requirements.txt

TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python gradio_server.py --profile 1 --sdpa Loading checkpoint shards: 100%|██████████████████| 3/3 [00:01<00:00, 2.81it/s] /home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:143: FutureWarning: torch.nn.utils.weight_normis deprecated in favor oftorch.nn.utils.parametrizations.weight_norm. WeightNorm.apply(module, name, dim) Traceback (most recent call last): File "/home/superuser/MyPrograms/yuegp/YuEGP/inference/gradio_server.py", line 135, in <module> parameter_dict = torch.load(args.resume_path, map_location='cpu') File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/torch/serialization.py", line 1470, 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, do those steps only if you trust the source of the checkpoint. (1) In PyTorch 2.6, we changed the default value of the weights_onlyargument intorch.loadfromFalsetoTrue. Re-running torch.loadwithweights_onlyset toFalsewill 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 withweights_only=Trueplease check the recommended steps in the following error message. WeightsUnpickler error: Unsupported global: GLOBAL omegaconf.listconfig.ListConfig was not an allowed global by default. Please usetorch.serialization.add_safe_globals([ListConfig])or thetorch.serialization.safe_globals([ListConfig])` 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.
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5e10>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5ab0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5bd0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5cf0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5d80>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2ea5f520>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2ea5f130>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2ea5fbe0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2ea5f0a0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee35ce4af0>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5c60>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee2eae5a20>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x7fee35ce5240>
Traceback (most recent call last):
File "/home/superuser/.pyenv/versions/yuegp/lib/python3.10/site-packages/mmgp/safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
(yuegp) superuser@server3:~/MyPrograms/yuegp/YuEGP/inference$


even though i am using the --sdpa switch at launch,,, in the end the script is trying to use safetensors which pytorch-rocm does not use??

TIA

`

@JohnnyStreet
Copy link

What comes before the errors there? If it's something about torch.nn.Buffers not existing, you are likely on the wrong version of torch.

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

4 participants