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

error when python vlog_read_script_sample.py script #9

Open
shanghailiwei opened this issue Mar 16, 2024 · 7 comments
Open

error when python vlog_read_script_sample.py script #9

shanghailiwei opened this issue Mar 16, 2024 · 7 comments

Comments

@shanghailiwei
Copy link

vlogger_backup) root@ubuntu-vm01:/sdb/github/Vlogger# python sample_scripts/vlog_read_script_sample.py
/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
/sdb/github/Vlogger
Seed set to 3407
pretrained/stable-diffusion-v1-4/unet/config.json
Traceback (most recent call last):
File "/sdb/github/Vlogger/sample_scripts/vlog_read_script_sample.py", line 304, in
main(omega_conf)
File "/sdb/github/Vlogger/sample_scripts/vlog_read_script_sample.py", line 119, in main
model = get_models(args).to(device)
File "/sdb/github/Vlogger/models/init.py", line 30, in get_models
return UNet3DConditionModel.from_pretrained_2d(pretrained_model_path, subfolder="unet", use_concat=args.use_mask)
File "/sdb/github/Vlogger/models/unet.py", line 654, in from_pretrained_2d
state_dict = torch.load(model_file, map_location="cpu")
File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/site-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/site-packages/torch/serialization.py", line 1258, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

@zhuangshaobin
Copy link
Collaborator

Here are some steps to troubleshoot this error:

· Verify that the file you are trying to load (model_file) exists and is complete.

· Ensure that the file is indeed a pickle file and that it has not been accidentally modified or corrupted.

· If you have access to the original file or a backup, try replacing the possibly corrupted file with a known good version.

· If this file is downloaded from the internet, make sure the download was successful and the file is not partially downloaded.

@shanghailiwei
Copy link
Author

thanks for your reply and guiding,I just downloaded and pass to the next step.

Traceback (most recent call last):
File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 306, in
main(omega_conf)
File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 160, in main
video_list = readscript(args.script_file_path)
File "/sdb/github/Vlogger/vlogger/planning_utils/gpt4_utils.py", line 531, in readscript
video_fragments = ast.literal_eval(script)
File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 64, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
ValueError: source code string cannot contain null bytes

@shanghailiwei
Copy link
Author

Claude3 tell me to add teh sub sentence, solve the problem.
reference_file = f.read()
reference_file = re.sub(r'\x00', '', reference_file) # Remove null bytes

@zhuangshaobin
Copy link
Collaborator

Claude3 tell me to add teh sub sentence, solve the problem. reference_file = f.read() reference_file = re.sub(r'\x00', '', reference_file) # Remove null bytes

I appreciate Claude3's answer and thank you for your attention to our project~!

@shanghailiwei
Copy link
Author

(vlogger_backup) root@ubuntu-vm01:/sdb/github/Vlogger# python sample_scripts/vlog_read_script_sample.py
Seed set to 3407
pretrained/stable-diffusion-v1-4/unet/config.json
Warnning: using half percision for inferencing!
model ready!

protagonists ready!
video script ready!
reference script ready!
zh script ready!
time script ready!
Generating the (Teddy bear in a kid's room.) prompt, keep this status long time. GPU memory consume 18.52G, bug GPU 0%, what can I do for the next step.

@YanzhaoDrew
Copy link

YanzhaoDrew commented Mar 19, 2024

thanks for your reply and guiding,I just downloaded and pass to the next step.

Traceback (most recent call last): File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 306, in main(omega_conf) File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 160, in main video_list = readscript(args.script_file_path) File "/sdb/github/Vlogger/vlogger/planning_utils/gpt4_utils.py", line 531, in readscript video_fragments = ast.literal_eval(script) File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 64, in literal_eval node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval') File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, ValueError: source code string cannot contain null bytes

I found that error reason is that the files from results/vlog/teddy_travel/script/protagonist_place_reference.txt and results/vlog/teddy_travel/script/video_prompts.txtcontain Garbled characters. We need to replace those characters with corresponding scripts. It would be better that the author recorrects those files.
图片

@zhuangshaobin
Copy link
Collaborator

thanks for your reply and guiding,I just downloaded and pass to the next step.
Traceback (most recent call last): File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 306, in main(omega_conf) File "/sdb/github/Vlogger/vlog_read_script_sample.py", line 160, in main video_list = readscript(args.script_file_path) File "/sdb/github/Vlogger/vlogger/planning_utils/gpt4_utils.py", line 531, in readscript video_fragments = ast.literal_eval(script) File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 64, in literal_eval node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval') File "/sdb/anaconda3/envs/vlogger_backup/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, ValueError: source code string cannot contain null bytes

I found that error reason is that the files from results/vlog/teddy_travel/script/protagonist_place_reference.txt and results/vlog/teddy_travel/script/video_prompts.txtcontain Garbled characters. We need to replace those characters with corresponding scripts. It would be better that the author recorrects those files. 图片

Thanks, this is indeed an oversight on my part and I will resolve this issue as soon as possible after checking.

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

3 participants