Skip to content

Non-deterministic Results Despite Fixing Random Seeds in video summarization #7

@Doran-fans

Description

@Doran-fans

Hi, thank you for sharing the code for VideoSAGE — really appreciate your contribution!

I noticed that the results vary across different runs, even when I fix all random seeds. I added the following function to control randomness:

def seed_torch(seed=1029):
import os, random, numpy as np
import torch

random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)

torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
torch.use_deterministic_algorithms(True)

Still, the results are not deterministic.
Just wondering — is this expected behavior? Or are there any additional steps needed to fully control randomness in your code?
Thanks again for your great work!

Best regards,
ruifanzhao

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions