Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'seek' #6

@nqkpro96

Description

@nqkpro96

Hi, I had try to training but it always get this error:
`(mystyle) root@homepc:/mnt/e/MyStyle/mystyle# python train.py --images_dir "/mnt/e/MyStyle/mystyle/training/images/Female" --output_dir "/mnt/e/MyStyle/mystyle/training/Female.model" --generator_path "/mnt/e/MyStyle/mystyle/ffhq.pkl"
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xe
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xe
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xe
Path to anchors was not given, inferring them on the fly...
Traceback (most recent call last):
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 308, in _check_seekable
f.seek(f.tell())
AttributeError: 'NoneType' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/e/MyStyle/mystyle/train.py", line 107, in
main()
File "/mnt/e/MyStyle/mystyle/train.py", line 90, in main
dataset = get_data(args)
File "/mnt/e/MyStyle/mystyle/train.py", line 38, in get_data
dataset = infer_anchors.invert(args.images_dir, args.encoder_checkpoint,
File "/mnt/e/MyStyle/mystyle/infer_anchors.py", line 56, in invert
encoder = inversion_encoder.InversionEncoder(encoder_checkpoint, torch.device(f'cuda'))
File "/mnt/e/MyStyle/mystyle/inversion_encoder.py", line 30, in init
ckpt = torch.load(checkpoint_path, map_location='cpu')
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 235, in _open_file_like
return _open_buffer_reader(name_or_buffer)
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 220, in init
_check_seekable(buffer)
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 311, in _check_seekable
raise_err_msg(["seek", "tell"], e)
File "/root/miniconda3/envs/mystyle/lib/python3.9/site-packages/torch/serialization.py", line 304, in raise_err_msg
raise type(e)(msg)
AttributeError: 'NoneType' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.`

I have use both ffhq.pkl and W Inversion Encoder and both of them get the same error. Or I use wrong model, please give me more detail in instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions