Skip to content

cannot re-initialize CUDA in forked subproess #129

Open
@chumingqian

Description

@chumingqian

Is any friend meet this situation,

i already solve this problem :
by using

import torch.multiprocessing as mp

def get_mean_and_std_4channel(dataset):
    '''Compute the mean and std value of dataset.'''
    mp.set_start_method('spawn') # set multiprocessing context to 'spawn'
    dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, num_workers=2, multiprocessing_context='spawn')
    mean = torch.zeros(4)

However , the cuda also dumped because out of memory, for the 380*400 resolution, batch size =2, channel=3, nfft =2048, but i set trainable Mel and stft both are False.

It takes 23 G cuda memory,

so, is there any method reduce the cuda memory cost

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions