From dd253fdecd98acbfa34c33e6db9f08d6ab7e2c6d Mon Sep 17 00:00:00 2001 From: liuwenran <448073814@qq.com> Date: Mon, 4 Sep 2023 15:10:15 +0800 Subject: [PATCH 1/3] check ci --- ...t_base_mmedit_inferencer.py => test_base_mmagic_inferencer.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/test_apis/test_inferencers/{test_base_mmedit_inferencer.py => test_base_mmagic_inferencer.py} (100%) diff --git a/tests/test_apis/test_inferencers/test_base_mmedit_inferencer.py b/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py similarity index 100% rename from tests/test_apis/test_inferencers/test_base_mmedit_inferencer.py rename to tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py From 302350e26b2eb10f1bcdfabc9a5b0ccede12c001 Mon Sep 17 00:00:00 2001 From: liuwenran <448073814@qq.com> Date: Mon, 4 Sep 2023 17:46:36 +0800 Subject: [PATCH 2/3] add gc after each test --- tests/configs/aot_test.py | 5 +++++ tests/configs/deepfillv1_test.py | 5 +++++ tests/configs/gl_test.py | 5 +++++ tests/configs/one_stage_gl.py | 5 +++++ tests/configs/pconv_test.py | 5 +++++ tests/configs/two_stage_test.py | 5 +++++ .../test_inferencers/test_base_mmagic_inferencer.py | 5 +++++ .../test_inferencers/test_colorization_inferencer.py | 5 +++++ .../test_inferencers/test_conditional_inferencer.py | 5 +++++ tests/test_apis/test_inferencers/test_eg3d_inferencer.py | 5 +++++ .../test_image_super_resolution_inferencer.py | 5 +++++ tests/test_apis/test_inferencers/test_inference_functions.py | 5 +++++ .../test_apis/test_inferencers/test_inpainting_inferencer.py | 5 +++++ tests/test_apis/test_inferencers/test_matting_inferencer.py | 5 +++++ tests/test_apis/test_inferencers/test_mmedit_inferencer.py | 5 +++++ .../test_inferencers/test_text2image_inferencers.py | 5 +++++ .../test_inferencers/test_translation_inferencer.py | 5 +++++ .../test_inferencers/test_unconditional_inferencer.py | 5 +++++ .../test_inferencers/test_video_interpolation_inferencer.py | 5 +++++ .../test_inferencers/test_video_restoration_inferencer.py | 5 +++++ tests/test_apis/test_mmagic_inferencer.py | 5 +++++ tests/test_datasets/test_basic_conditional_dataset.py | 5 +++++ tests/test_datasets/test_basic_frames_dataset.py | 5 +++++ tests/test_datasets/test_basic_image_dataset.py | 5 +++++ tests/test_datasets/test_categories.py | 5 +++++ tests/test_datasets/test_cifar10_dataset.py | 5 +++++ tests/test_datasets/test_comp1k_dataset.py | 5 +++++ tests/test_datasets/test_controlnet_dataset.py | 5 +++++ tests/test_datasets/test_data_utils.py | 5 +++++ tests/test_datasets/test_dreambooth_dataset.py | 5 +++++ tests/test_datasets/test_grow_scale_image_dataset.py | 5 +++++ tests/test_datasets/test_imagenet_dataset.py | 5 +++++ tests/test_datasets/test_mscoco_dataset.py | 5 +++++ tests/test_datasets/test_paired_image_dataset.py | 5 +++++ tests/test_datasets/test_singan_dataset.py | 5 +++++ tests/test_datasets/test_transforms/test_albumentations.py | 5 +++++ tests/test_datasets/test_transforms/test_alpha.py | 5 +++++ tests/test_datasets/test_transforms/test_aug_frames.py | 5 +++++ tests/test_datasets/test_transforms/test_aug_pixel.py | 5 +++++ tests/test_datasets/test_transforms/test_aug_shape.py | 5 +++++ tests/test_datasets/test_transforms/test_blur_kernels.py | 5 +++++ tests/test_datasets/test_transforms/test_crop.py | 5 +++++ tests/test_datasets/test_transforms/test_fgbg.py | 5 +++++ tests/test_datasets/test_transforms/test_formatting.py | 5 +++++ .../test_datasets/test_transforms/test_generate_assistant.py | 5 +++++ .../test_transforms/test_generate_frame_indices.py | 5 +++++ tests/test_datasets/test_transforms/test_get_masked_image.py | 5 +++++ tests/test_datasets/test_transforms/test_loading.py | 5 +++++ .../test_datasets/test_transforms/test_matlab_like_resize.py | 5 +++++ tests/test_datasets/test_transforms/test_normalization.py | 5 +++++ .../test_transforms/test_random_degradations.py | 5 +++++ .../test_transforms/test_random_down_sampling.py | 5 +++++ tests/test_datasets/test_transforms/test_trimap.py | 5 +++++ tests/test_datasets/test_transforms/test_values.py | 5 +++++ tests/test_datasets/test_unpaired_image_dataset.py | 5 +++++ tests/test_engine/test_hooks/test_ema.py | 5 +++++ tests/test_engine/test_hooks/test_iter_time_hook.py | 5 +++++ tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py | 5 +++++ tests/test_engine/test_hooks/test_pickle_data_hook.py | 5 +++++ .../test_engine/test_hooks/test_reduce_lr_scheduler_hook.py | 5 +++++ tests/test_engine/test_hooks/test_visualization_hook.py | 5 +++++ .../test_optimizers/test_multi_optimizer_constructor.py | 5 +++++ .../test_optimizers/test_pggan_optimizer_constructor.py | 5 +++++ .../test_optimizers/test_singan_optimizer_constructor.py | 5 +++++ tests/test_engine/test_runner/test_log_processor.py | 5 +++++ tests/test_engine/test_runner/test_loop_utils.py | 5 +++++ tests/test_engine/test_runner/test_multi_loops.py | 5 +++++ .../test_linear_lr_scheduler_with_interval.py | 5 +++++ .../test_engine/test_schedulers/test_reduce_lr_scheduler.py | 5 +++++ tests/test_evaluation/test_evaluator.py | 5 +++++ tests/test_evaluation/test_functional/test_fid_inception.py | 5 +++++ tests/test_evaluation/test_functional/test_gaussian_funcs.py | 5 +++++ .../test_evaluation/test_functional/test_inception_utils.py | 5 +++++ tests/test_evaluation/test_metrics/test_base_gen_metric.py | 5 +++++ .../test_metrics/test_base_sample_wise_metric.py | 5 +++++ .../test_evaluation/test_metrics/test_connectivity_error.py | 5 +++++ tests/test_evaluation/test_metrics/test_equivariance.py | 5 +++++ tests/test_evaluation/test_metrics/test_fid.py | 5 +++++ tests/test_evaluation/test_metrics/test_gradient_error.py | 5 +++++ tests/test_evaluation/test_metrics/test_inception_score.py | 5 +++++ tests/test_evaluation/test_metrics/test_mae.py | 5 +++++ tests/test_evaluation/test_metrics/test_matting_mse.py | 5 +++++ tests/test_evaluation/test_metrics/test_metrics_utils.py | 5 +++++ tests/test_evaluation/test_metrics/test_ms_ssim.py | 5 +++++ tests/test_evaluation/test_metrics/test_mse.py | 5 +++++ tests/test_evaluation/test_metrics/test_niqe.py | 5 +++++ tests/test_evaluation/test_metrics/test_ppl.py | 5 +++++ .../test_metrics/test_precision_and_recall.py | 5 +++++ tests/test_evaluation/test_metrics/test_psnr.py | 5 +++++ tests/test_evaluation/test_metrics/test_sad.py | 5 +++++ tests/test_evaluation/test_metrics/test_snr.py | 5 +++++ tests/test_evaluation/test_metrics/test_ssim.py | 5 +++++ tests/test_evaluation/test_metrics/test_swd.py | 5 +++++ tests/test_models/test_archs/test_aspp.py | 5 +++++ tests/test_models/test_archs/test_conv.py | 5 +++++ tests/test_models/test_archs/test_downsample.py | 5 +++++ tests/test_models/test_archs/test_ensemble.py | 5 +++++ tests/test_models/test_archs/test_gated_conv_module.py | 5 +++++ tests/test_models/test_archs/test_img_normalize.py | 5 +++++ tests/test_models/test_archs/test_linear_module.py | 5 +++++ tests/test_models/test_archs/test_lora.py | 5 +++++ tests/test_models/test_archs/test_multi_layer_disc.py | 5 +++++ tests/test_models/test_archs/test_patch_disc.py | 5 +++++ tests/test_models/test_archs/test_resnet.py | 5 +++++ tests/test_models/test_archs/test_separable_conv_module.py | 5 +++++ tests/test_models/test_archs/test_simple_encoder_decoder.py | 5 +++++ tests/test_models/test_archs/test_smpatch_disc.py | 5 +++++ tests/test_models/test_archs/test_sr_backbone.py | 5 +++++ tests/test_models/test_archs/test_tokenizer.py | 5 +++++ tests/test_models/test_archs/test_upsample.py | 5 +++++ tests/test_models/test_archs/test_vgg.py | 5 +++++ tests/test_models/test_archs/test_wrapper.py | 5 +++++ tests/test_models/test_base_models/test_average_model.py | 5 +++++ .../test_base_models/test_base_conditional_gan.py | 5 +++++ tests/test_models/test_base_models/test_base_edit_model.py | 5 +++++ tests/test_models/test_base_models/test_base_gan.py | 5 +++++ tests/test_models/test_base_models/test_base_mattor.py | 5 +++++ .../test_base_models/test_base_translation_model.py | 5 +++++ .../test_models/test_base_models/test_basic_interpolator.py | 5 +++++ tests/test_models/test_base_models/test_one_stage.py | 5 +++++ tests/test_models/test_base_models/test_two_stage.py | 5 +++++ .../test_data_preprocessors/test_data_preprocessor.py | 5 +++++ .../test_data_preprocessors/test_mattor_preprocessor.py | 5 +++++ .../test_diffusion_schedulers/test_ddim_scheduler.py | 5 +++++ tests/test_models/test_diffusion_schedulers/test_init.py | 5 +++++ .../test_models/test_editors/test_aotgan/test_aot_decoder.py | 5 +++++ .../test_models/test_editors/test_aotgan/test_aot_encoder.py | 5 +++++ .../test_editors/test_aotgan/test_aot_encoder_decoder.py | 5 +++++ .../test_editors/test_aotgan/test_aot_inpaintor.py | 5 +++++ tests/test_models/test_editors/test_aotgan/test_aot_neck.py | 5 +++++ .../test_editors/test_arcface/test_arcface_modules.py | 5 +++++ tests/test_models/test_editors/test_arcface/test_id_loss.py | 5 +++++ .../test_models/test_editors/test_arcface/test_model_irse.py | 5 +++++ .../test_models/test_editors/test_basicvsr/test_basicvsr.py | 5 +++++ .../test_editors/test_basicvsr/test_basicvsr_net.py | 5 +++++ .../test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py | 5 +++++ tests/test_models/test_editors/test_biggan/test_biggan.py | 5 +++++ .../test_biggan/test_biggan_deep_discriminator.py | 5 +++++ .../test_editors/test_biggan/test_biggan_deep_generator.py | 5 +++++ .../test_editors/test_biggan/test_biggan_discriminator.py | 5 +++++ .../test_editors/test_biggan/test_biggan_generator.py | 5 +++++ .../test_editors/test_biggan/test_biggan_modules.py | 5 +++++ .../test_editors/test_biggan/test_biggan_snmodule.py | 5 +++++ tests/test_models/test_editors/test_cain/test_cain.py | 5 +++++ tests/test_models/test_editors/test_cain/test_cain_net.py | 5 +++++ .../test_editors/test_controlnet/test_controlnet.py | 5 +++++ .../test_editors/test_controlnet/test_controlnet_utils.py | 5 +++++ .../test_models/test_editors/test_cyclegan/test_cyclegan.py | 5 +++++ .../test_editors/test_cyclegan/test_cyclegan_generator.py | 5 +++++ .../test_editors/test_cyclegan/test_cyclegan_modules.py | 5 +++++ tests/test_models/test_editors/test_dcgan/test_dcgan.py | 5 +++++ .../test_editors/test_dcgan/test_dcgan_discriminator.py | 5 +++++ .../test_editors/test_dcgan/test_dcgan_generator.py | 5 +++++ tests/test_models/test_editors/test_ddpm/test_attention.py | 5 +++++ .../test_editors/test_ddpm/test_ddpm_scheduler.py | 5 +++++ .../test_editors/test_ddpm/test_denoising_unet.py | 5 +++++ tests/test_models/test_editors/test_ddpm/test_embeddings.py | 5 +++++ tests/test_models/test_editors/test_ddpm/test_res_blocks.py | 5 +++++ tests/test_models/test_editors/test_ddpm/test_unet_blocks.py | 5 +++++ .../test_editors/test_deblurganv2/test_deblurganv2.py | 5 +++++ .../test_deblurganv2/test_deblurganv2_discriminator.py | 5 +++++ .../test_deblurganv2/test_deblurganv2_generator.py | 5 +++++ .../test_deepfillv1/test_contextual_attention.py | 5 +++++ .../test_deepfillv1/test_contextual_attention_neck.py | 5 +++++ .../test_editors/test_deepfillv1/test_deepfill_decoder.py | 5 +++++ .../test_editors/test_deepfillv1/test_deepfill_disc.py | 5 +++++ .../test_editors/test_deepfillv1/test_deepfill_encoder.py | 5 +++++ .../test_editors/test_deepfillv1/test_deepfill_refiner.py | 5 +++++ .../test_editors/test_deepfillv1/test_deepfillv1.py | 5 +++++ .../test_deepfillv2/test_two_stage_encoder_decoder.py | 5 +++++ tests/test_models/test_editors/test_dic/test_dic.py | 5 +++++ tests/test_models/test_editors/test_dic/test_dic_net.py | 5 +++++ .../test_editors/test_dic/test_feedback_hour_glass.py | 5 +++++ tests/test_models/test_editors/test_dic/test_light_cnn.py | 5 +++++ tests/test_models/test_editors/test_dim/test_dim.py | 5 +++++ .../test_disco_diffusion/test_disco_diffusion.py | 5 +++++ .../test_disco_diffusion_clip_wrapper.py | 5 +++++ .../test_editors/test_dreambooth/test_dreambooth.py | 5 +++++ tests/test_models/test_editors/test_duf/test_duf.py | 5 +++++ tests/test_models/test_editors/test_edsr/test_edsr_net.py | 5 +++++ tests/test_models/test_editors/test_edvr/test_edvr.py | 5 +++++ tests/test_models/test_editors/test_edvr/test_edvr_net.py | 5 +++++ tests/test_models/test_editors/test_eg3d/test_camera.py | 5 +++++ .../test_editors/test_eg3d/test_dual_discriminator.py | 5 +++++ tests/test_models/test_editors/test_eg3d/test_eg3d.py | 5 +++++ .../test_editors/test_eg3d/test_eg3d_generator.py | 5 +++++ .../test_models/test_editors/test_eg3d/test_eg3d_modules.py | 5 +++++ tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py | 5 +++++ tests/test_models/test_editors/test_eg3d/test_ray_sampler.py | 5 +++++ tests/test_models/test_editors/test_eg3d/test_renderer.py | 5 +++++ tests/test_models/test_editors/test_esrgan/test_esrgan.py | 5 +++++ tests/test_models/test_editors/test_esrgan/test_rrdb_net.py | 5 +++++ tests/test_models/test_editors/test_fba/test_fba_decoder.py | 5 +++++ tests/test_models/test_editors/test_fba/test_fba_encoder.py | 5 +++++ tests/test_models/test_editors/test_flavr/test_flavr.py | 5 +++++ tests/test_models/test_editors/test_flavr/test_flavr_net.py | 5 +++++ tests/test_models/test_editors/test_gca/test_gca.py | 5 +++++ tests/test_models/test_editors/test_gca/test_gca_module.py | 5 +++++ tests/test_models/test_editors/test_gca/test_resgca_dec.py | 5 +++++ tests/test_models/test_editors/test_gca/test_resgca_enc.py | 5 +++++ tests/test_models/test_editors/test_ggan/test_ggan.py | 5 +++++ .../test_editors/test_glean/test_glean_styleganv2.py | 5 +++++ tests/test_models/test_editors/test_glide/test_glide.py | 5 +++++ .../test_editors/test_global_local/test_gl_decoder.py | 5 +++++ .../test_editors/test_global_local/test_gl_dilation.py | 5 +++++ .../test_editors/test_global_local/test_gl_disc.py | 5 +++++ .../test_editors/test_global_local/test_gl_encoder.py | 5 +++++ .../test_global_local/test_gl_encoder_decoder.py | 5 +++++ .../test_editors/test_global_local/test_gl_inpaintor.py | 5 +++++ .../test_editors/test_guided_diffusion/test_adm.py | 5 +++++ .../test_editors/test_iconvsr/test_iconvsr_net.py | 5 +++++ .../test_models/test_editors/test_indexnet/test_indexnet.py | 5 +++++ .../test_editors/test_indexnet/test_indexnet_decoder.py | 5 +++++ .../test_editors/test_indexnet/test_indexnet_encoder.py | 5 +++++ .../test_editors/test_inst_colorization/test_color_utils.py | 5 +++++ .../test_inst_colorization/test_colorization_net.py | 5 +++++ .../test_editors/test_inst_colorization/test_fusion_net.py | 5 +++++ .../test_inst_colorization/test_inst_colorization.py | 5 +++++ .../test_editors/test_inst_colorization/test_weight_layer.py | 5 +++++ tests/test_models/test_editors/test_liif/test_liif.py | 5 +++++ tests/test_models/test_editors/test_liif/test_liif_net.py | 5 +++++ tests/test_models/test_editors/test_liif/test_mlp_refiner.py | 5 +++++ tests/test_models/test_editors/test_lsgan/test_lsgan.py | 5 +++++ .../test_editors/test_lsgan/test_lsgan_discriminator.py | 5 +++++ .../test_editors/test_lsgan/test_lsgan_generator.py | 5 +++++ .../test_editors/test_mspie/test_mspie_stylegan2.py | 5 +++++ .../test_mspie/test_mspie_stylegan2_discriminator.py | 5 +++++ .../test_mspie/test_mspie_stylegan2_generator.py | 5 +++++ .../test_editors/test_mspie/test_mspie_stylegan2_modules.py | 5 +++++ tests/test_models/test_editors/test_mspie/test_pe_singan.py | 5 +++++ .../test_editors/test_mspie/test_pe_singan_generator.py | 5 +++++ .../test_editors/test_mspie/test_positional_encoding.py | 5 +++++ .../test_editors/test_nafnet/test_naf_avgpool2d.py | 5 +++++ .../test_editors/test_nafnet/test_naf_layernorm2d.py | 5 +++++ .../test_models/test_editors/test_nafnet/test_nafbaseline.py | 5 +++++ tests/test_models/test_editors/test_nafnet/test_nafnet.py | 5 +++++ .../test_editors/test_pconv/test_mask_conv_module.py | 5 +++++ .../test_models/test_editors/test_pconv/test_partial_conv.py | 5 +++++ .../test_editors/test_pconv/test_pconv_decoder.py | 5 +++++ .../test_editors/test_pconv/test_pconv_encoder.py | 5 +++++ .../test_editors/test_pconv/test_pconv_encoder_decoder.py | 5 +++++ .../test_editors/test_pconv/test_pconv_inpaintor.py | 5 +++++ tests/test_models/test_editors/test_pggan/test_pggan.py | 5 +++++ .../test_editors/test_pggan/test_pggan_discriminator.py | 5 +++++ .../test_editors/test_pggan/test_pggan_generator.py | 5 +++++ .../test_editors/test_pggan/test_pggan_modules.py | 5 +++++ tests/test_models/test_editors/test_pix2pix/test_pix2pix.py | 5 +++++ .../test_editors/test_pix2pix/test_pix2pix_generator.py | 5 +++++ .../test_editors/test_pix2pix/test_pix2pix_modules.py | 5 +++++ .../test_editors/test_plain/test_plain_decoder.py | 5 +++++ .../test_editors/test_plain/test_plain_refiner.py | 5 +++++ tests/test_models/test_editors/test_rdn/test_rdn_net.py | 5 +++++ .../test_editors/test_real_basicvsr/test_real_basicvsr.py | 5 +++++ .../test_real_basicvsr/test_real_basicvsr_net.py | 5 +++++ .../test_editors/test_real_esrgan/test_real_esrgan.py | 5 +++++ .../test_editors/test_real_esrgan/test_unet_disc.py | 5 +++++ .../test_editors/test_restormer/test_restormer_net.py | 5 +++++ tests/test_models/test_editors/test_sagan/test_sagan.py | 5 +++++ .../test_editors/test_sagan/test_sagan_discriminator.py | 5 +++++ .../test_editors/test_sagan/test_sagan_generator.py | 5 +++++ .../test_editors/test_sagan/test_sagan_modules.py | 5 +++++ tests/test_models/test_editors/test_singan/test_singan.py | 5 +++++ .../test_editors/test_singan/test_singan_discriminator.py | 5 +++++ .../test_editors/test_singan/test_singan_generator.py | 5 +++++ .../test_editors/test_singan/test_singan_modules.py | 5 +++++ tests/test_models/test_editors/test_srcnn/test_srcnn_net.py | 5 +++++ .../test_models/test_editors/test_srgan/test_modified_vgg.py | 5 +++++ tests/test_models/test_editors/test_srgan/test_sr_resnet.py | 5 +++++ tests/test_models/test_editors/test_srgan/test_srgan.py | 5 +++++ .../test_editors/test_stable_diffusion/test_clip_wrapper.py | 5 +++++ .../test_stable_diffusion/test_stable_diffusion.py | 5 +++++ .../test_stable_diffusion/test_stable_diffusion_inpaint.py | 5 +++++ .../test_stable_diffusion/test_stable_diffusion_tomesd.py | 5 +++++ .../test_editors/test_stable_diffusion/test_vae.py | 5 +++++ .../test_editors/test_stylegan1/test_stylegan1.py | 5 +++++ .../test_stylegan1/test_stylegan1_discriminator.py | 5 +++++ .../test_editors/test_stylegan1/test_stylegan1_generator.py | 5 +++++ .../test_editors/test_stylegan1/test_stylegan1_modules.py | 5 +++++ .../test_editors/test_stylegan1/test_stylegan_utils.py | 5 +++++ .../test_editors/test_stylegan2/test_ada/test_augment.py | 5 +++++ .../test_editors/test_stylegan2/test_stylegan2.py | 5 +++++ .../test_stylegan2/test_stylegan2_discriminator.py | 5 +++++ .../test_editors/test_stylegan2/test_stylegan2_generator.py | 5 +++++ .../test_editors/test_stylegan2/test_stylegan2_modules.py | 5 +++++ .../test_editors/test_stylegan3/test_stylegan3.py | 5 +++++ .../test_editors/test_stylegan3/test_stylegan3_generator.py | 5 +++++ .../test_editors/test_stylegan3/test_stylegan3_modules.py | 5 +++++ .../test_editors/test_stylegan3/test_stylegan3_utils.py | 5 +++++ .../test_editors/test_swinir/test_swinir_modules.py | 5 +++++ .../test_models/test_editors/test_swinir/test_swinir_net.py | 5 +++++ .../test_models/test_editors/test_swinir/test_swinir_rstb.py | 5 +++++ .../test_editors/test_swinir/test_swinir_utils.py | 5 +++++ tests/test_models/test_editors/test_tdan/test_tdan.py | 5 +++++ tests/test_models/test_editors/test_tdan/test_tdan_net.py | 5 +++++ tests/test_models/test_editors/test_tof/test_tof_vfi_net.py | 5 +++++ tests/test_models/test_editors/test_tof/test_tof_vsr_net.py | 5 +++++ tests/test_models/test_editors/test_ttsr/test_lte.py | 5 +++++ .../test_editors/test_ttsr/test_search_transformer.py | 5 +++++ tests/test_models/test_editors/test_ttsr/test_ttsr.py | 5 +++++ tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py | 5 +++++ tests/test_models/test_editors/test_ttsr/test_ttsr_net.py | 5 +++++ .../test_editors/test_wgan_gp/test_wgan_discriminator.py | 5 +++++ .../test_editors/test_wgan_gp/test_wgan_generator.py | 5 +++++ tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py | 5 +++++ .../test_editors/test_wgan_gp/test_wgan_gp_module.py | 5 +++++ tests/test_models/test_losses/test_clip_loss.py | 5 +++++ tests/test_models/test_losses/test_composition_loss.py | 5 +++++ tests/test_models/test_losses/test_face_id_loss.py | 5 +++++ tests/test_models/test_losses/test_feature_loss.py | 5 +++++ tests/test_models/test_losses/test_gan_loss.py | 5 +++++ tests/test_models/test_losses/test_gradient_loss.py | 5 +++++ .../test_losses/test_loss_comps/test_clip_loss_comps.py | 5 +++++ .../test_loss_comps/test_disc_auxiliary_loss_comps.py | 5 +++++ .../test_losses/test_loss_comps/test_face_id_loss_comps.py | 5 +++++ .../test_losses/test_loss_comps/test_gan_loss_comps.py | 5 +++++ .../test_loss_comps/test_gen_auxiliary_loss_comps.py | 5 +++++ tests/test_models/test_losses/test_loss_wrapper.py | 5 +++++ tests/test_models/test_losses/test_perceptual_loss.py | 5 +++++ tests/test_models/test_losses/test_pixelwise_loss.py | 5 +++++ tests/test_models/test_utils/test_bbox_utils.py | 5 +++++ tests/test_models/test_utils/test_flow_warp.py | 5 +++++ tests/test_models/test_utils/test_model_utils.py | 5 +++++ tests/test_models/test_utils/test_sampling_utils.py | 5 +++++ tests/test_models/test_utils/test_tensor_utils.py | 5 +++++ tests/test_structures/test_data_sample.py | 5 +++++ tests/test_utils/test_cli.py | 5 +++++ tests/test_utils/test_img_utils.py | 5 +++++ tests/test_utils/test_io_utils.py | 5 +++++ tests/test_utils/test_logger.py | 5 +++++ tests/test_utils/test_sampler.py | 5 +++++ tests/test_utils/test_setup_env.py | 5 +++++ tests/test_utils/test_trans_utils.py | 5 +++++ tests/test_visualization/test_concat_visualizer.py | 5 +++++ tests/test_visualization/test_vis_backend.py | 5 +++++ tests/test_visualization/test_visualizer.py | 5 +++++ 335 files changed, 1675 insertions(+) diff --git a/tests/configs/aot_test.py b/tests/configs/aot_test.py index a4613c146c..70c8e5ab5a 100644 --- a/tests/configs/aot_test.py +++ b/tests/configs/aot_test.py @@ -53,3 +53,8 @@ ), loss_disc_shift=dict(type='DiscShiftLoss', loss_weight=0.001), ) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/configs/deepfillv1_test.py b/tests/configs/deepfillv1_test.py index d3e7f10a73..c84fc25d7f 100644 --- a/tests/configs/deepfillv1_test.py +++ b/tests/configs/deepfillv1_test.py @@ -65,3 +65,8 @@ loss_disc_shift=dict(type='DiscShiftLoss', loss_weight=0.001), train_cfg=dict(disc_step=2, start_iter=0, local_size=(128, 128)), ) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/configs/gl_test.py b/tests/configs/gl_test.py index 3cdc97a7e8..583c02b067 100644 --- a/tests/configs/gl_test.py +++ b/tests/configs/gl_test.py @@ -130,3 +130,8 @@ dict(type='GetMaskedImage'), dict(type='PackInputs'), ] + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/configs/one_stage_gl.py b/tests/configs/one_stage_gl.py index b9455f398f..82cb52ecfd 100644 --- a/tests/configs/one_stage_gl.py +++ b/tests/configs/one_stage_gl.py @@ -41,3 +41,8 @@ loss_l1_valid=dict(type='L1Loss', loss_weight=1.0), loss_tv=dict(type='MaskedTVLoss', loss_weight=0.01), train_cfg=dict(disc_step=1)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/configs/pconv_test.py b/tests/configs/pconv_test.py index 2a94616e87..74aff22e1a 100644 --- a/tests/configs/pconv_test.py +++ b/tests/configs/pconv_test.py @@ -43,3 +43,8 @@ type='MaskedTVLoss', loss_weight=0.1, )) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/configs/two_stage_test.py b/tests/configs/two_stage_test.py index fe49633d19..d111a08ba1 100644 --- a/tests/configs/two_stage_test.py +++ b/tests/configs/two_stage_test.py @@ -106,3 +106,8 @@ ), loss_disc_shift=dict(type='DiscShiftLoss', loss_weight=0.001), ) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py b/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py index cd2b525605..5bc0564f79 100644 --- a/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py +++ b/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py @@ -23,3 +23,8 @@ def test_base_mmagic_inferencer(): inferencer_instance = BaseMMagicInferencer(cfg, None) extra_parameters = inferencer_instance.get_extra_parameters() assert len(extra_parameters) == 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_colorization_inferencer.py b/tests/test_apis/test_inferencers/test_colorization_inferencer.py index d42c260e35..0ecc7cbfee 100644 --- a/tests/test_apis/test_inferencers/test_colorization_inferencer.py +++ b/tests/test_apis/test_inferencers/test_colorization_inferencer.py @@ -44,3 +44,8 @@ def test_colorization_inferencer(): img=data_path, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.shape == (256, 256, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_conditional_inferencer.py b/tests/test_apis/test_inferencers/test_conditional_inferencer.py index 1764aaa00d..8e119e0a62 100644 --- a/tests/test_apis/test_inferencers/test_conditional_inferencer.py +++ b/tests/test_apis/test_inferencers/test_conditional_inferencer.py @@ -24,3 +24,8 @@ def test_conditional_inferencer(): label=1, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.shape == (4, 3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_eg3d_inferencer.py b/tests/test_apis/test_inferencers/test_eg3d_inferencer.py index 3c43df363a..ede4196dcf 100644 --- a/tests/test_apis/test_inferencers/test_eg3d_inferencer.py +++ b/tests/test_apis/test_inferencers/test_eg3d_inferencer.py @@ -157,3 +157,8 @@ def test_eg3d_inferencer(): interpolation='camera', num_images=2, result_out_dir=result_out_dir) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py b/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py index 6a18ec8444..d7230c9644 100644 --- a/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py +++ b/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py @@ -30,3 +30,8 @@ def test_image_super_resolution_inferencer(): img=img_path, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.shape == (480, 500, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_inference_functions.py b/tests/test_apis/test_inferencers/test_inference_functions.py index a8a493b57e..9677b31822 100644 --- a/tests/test_apis/test_inferencers/test_inference_functions.py +++ b/tests/test_apis/test_inferencers/test_inference_functions.py @@ -25,3 +25,8 @@ def test_calculate_grid_size(): target_nrow = (3, 3, 3, 1, 2) for bz, ratio, tar in zip(inp_batch_size, aspect_ratio, target_nrow): assert calculate_grid_size(bz, ratio) == tar + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_inpainting_inferencer.py b/tests/test_apis/test_inferencers/test_inpainting_inferencer.py index a1714a0488..5139853f2a 100644 --- a/tests/test_apis/test_inferencers/test_inpainting_inferencer.py +++ b/tests/test_apis/test_inferencers/test_inpainting_inferencer.py @@ -30,3 +30,8 @@ def test_inpainting_inferencer(): img=masked_img_path, mask=mask_path, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.shape == (256, 256, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_matting_inferencer.py b/tests/test_apis/test_inferencers/test_matting_inferencer.py index 12ecfbe549..4b513955db 100644 --- a/tests/test_apis/test_inferencers/test_matting_inferencer.py +++ b/tests/test_apis/test_inferencers/test_matting_inferencer.py @@ -22,3 +22,8 @@ def test_matting_inferencer(): img=img_path, trimap=trimap_path, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.numpy().shape == (552, 800) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_mmedit_inferencer.py b/tests/test_apis/test_inferencers/test_mmedit_inferencer.py index 3020d41630..4f7443f139 100644 --- a/tests/test_apis/test_inferencers/test_mmedit_inferencer.py +++ b/tests/test_apis/test_inferencers/test_mmedit_inferencer.py @@ -56,3 +56,8 @@ def test_mmagic_inferencer(): extra_parameters = inferencer_instance.get_extra_parameters() assert len(extra_parameters) == 2 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_text2image_inferencers.py b/tests/test_apis/test_inferencers/test_text2image_inferencers.py index 0699a1e5d8..c2caeacbe7 100644 --- a/tests/test_apis/test_inferencers/test_text2image_inferencers.py +++ b/tests/test_apis/test_inferencers/test_text2image_inferencers.py @@ -106,3 +106,8 @@ def test_translation(self): text=text, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img[0].cpu().numpy().shape == (3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_translation_inferencer.py b/tests/test_apis/test_inferencers/test_translation_inferencer.py index e11cccb897..f273de88c9 100644 --- a/tests/test_apis/test_inferencers/test_translation_inferencer.py +++ b/tests/test_apis/test_inferencers/test_translation_inferencer.py @@ -26,3 +26,8 @@ def test_translation_inferencer(): img=data_path, result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img[0].cpu().numpy().shape == (3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_unconditional_inferencer.py b/tests/test_apis/test_inferencers/test_unconditional_inferencer.py index 5eb7d5f27d..8dd8eb6b26 100644 --- a/tests/test_apis/test_inferencers/test_unconditional_inferencer.py +++ b/tests/test_apis/test_inferencers/test_unconditional_inferencer.py @@ -50,3 +50,8 @@ def test_unconditional_inferencer(): inference_result = inferencer_instance(result_out_dir=result_out_dir) result_img = inference_result[1] assert result_img.detach().numpy().shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py b/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py index 3a421c23df..bc1aa36b58 100644 --- a/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py +++ b/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py @@ -56,3 +56,8 @@ def test_video_interpolation_inferencer_fps_multiplier(): inference_result = inferencer_instance( video=video_path, result_out_dir=result_out_dir) assert inference_result is None + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py b/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py index 9afff1f1e0..9dc8950ffb 100644 --- a/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py +++ b/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py @@ -89,3 +89,8 @@ def test_video_restoration_inferencer_max_seq_len(): inference_result = inferencer_instance( video=video_path, result_out_dir=result_out_dir) assert inference_result is None + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_apis/test_mmagic_inferencer.py b/tests/test_apis/test_mmagic_inferencer.py index 4c2b4d4f3f..15965f440b 100644 --- a/tests/test_apis/test_mmagic_inferencer.py +++ b/tests/test_apis/test_mmagic_inferencer.py @@ -54,3 +54,8 @@ def test_edit(): if __name__ == '__main__': test_edit() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_basic_conditional_dataset.py b/tests/test_datasets/test_basic_conditional_dataset.py index 680c9416f8..037f8cb993 100644 --- a/tests/test_datasets/test_basic_conditional_dataset.py +++ b/tests/test_datasets/test_basic_conditional_dataset.py @@ -95,3 +95,8 @@ def test_init(self): [1, 2, 3, 4]) self.assertEqual(dataset[1]['data_samples'].gt_label.label.tolist(), [1, 4, 5, 3]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_basic_frames_dataset.py b/tests/test_datasets/test_basic_frames_dataset.py index d4ecfe0f00..0ffe5b870b 100644 --- a/tests/test_datasets/test_basic_frames_dataset.py +++ b/tests/test_datasets/test_basic_frames_dataset.py @@ -698,3 +698,8 @@ def test_vfi_ann_dataset(self): '00000000.png') ], sample_idx=1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_basic_image_dataset.py b/tests/test_datasets/test_basic_image_dataset.py index db4724acd1..dcbfe1bc10 100644 --- a/tests/test_datasets/test_basic_image_dataset.py +++ b/tests/test_datasets/test_basic_image_dataset.py @@ -170,3 +170,8 @@ def test_refsr_folder_dataset(self): gt_path=str(self.data_root / 'gt' / 'baboon.png'), ref_path=str(self.data_root / 'gt' / 'baboon.png'), sample_idx=0) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_categories.py b/tests/test_datasets/test_categories.py index 3c65d409b8..271364fe39 100644 --- a/tests/test_datasets/test_categories.py +++ b/tests/test_datasets/test_categories.py @@ -8,3 +8,8 @@ def test_cifar10_categories(): def test_imagenet_categories(): assert len(IMAGENET_CATEGORIES) == 1000 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_cifar10_dataset.py b/tests/test_datasets/test_cifar10_dataset.py index d0e7793bd7..2805e950ce 100644 --- a/tests/test_datasets/test_cifar10_dataset.py +++ b/tests/test_datasets/test_cifar10_dataset.py @@ -172,3 +172,8 @@ def test_extra_repr(self): @classmethod def tearDownClass(cls): cls.tmpdir.cleanup() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_comp1k_dataset.py b/tests/test_datasets/test_comp1k_dataset.py index 5f3c925b28..03233f836c 100644 --- a/tests/test_datasets/test_comp1k_dataset.py +++ b/tests/test_datasets/test_comp1k_dataset.py @@ -73,3 +73,8 @@ def test_comp1k_dataset(self): # assert 'alpha' in first_data # assert isinstance(first_data['alpha'], np.ndarray) # assert first_data['alpha'].shape == (552, 800) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_controlnet_dataset.py b/tests/test_datasets/test_controlnet_dataset.py index 2319c1134c..852ccd4deb 100644 --- a/tests/test_datasets/test_controlnet_dataset.py +++ b/tests/test_datasets/test_controlnet_dataset.py @@ -22,3 +22,8 @@ def test_controlnet_dataset(): assert 'source_path' in data assert 'target_path' in data assert data['prompt'] == prompts[idx] + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_data_utils.py b/tests/test_datasets/test_data_utils.py index e6a25c34a8..5cb614777a 100644 --- a/tests/test_datasets/test_data_utils.py +++ b/tests/test_datasets/test_data_utils.py @@ -20,3 +20,8 @@ def test_infer_io_backend(): # TODO: add more uts + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_dreambooth_dataset.py b/tests/test_datasets/test_dreambooth_dataset.py index 781f744800..7f2036abbd 100644 --- a/tests/test_datasets/test_dreambooth_dataset.py +++ b/tests/test_datasets/test_dreambooth_dataset.py @@ -18,3 +18,8 @@ def test_dreambooth_dataset(): assert len(dataset) == 2 for data in dataset: assert data['prompt'] == 'a sks ball' + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_grow_scale_image_dataset.py b/tests/test_datasets/test_grow_scale_image_dataset.py index 28636f8df2..fe0f4d3a63 100644 --- a/tests/test_datasets/test_grow_scale_image_dataset.py +++ b/tests/test_datasets/test_grow_scale_image_dataset.py @@ -99,3 +99,8 @@ def test_dynamic_unconditional_img_dataset(self): with pytest.raises(AssertionError): _ = GrowScaleImgDataset(10, self.default_pipeline, 10.) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_imagenet_dataset.py b/tests/test_datasets/test_imagenet_dataset.py index a9f0b28820..6718622383 100644 --- a/tests/test_datasets/test_imagenet_dataset.py +++ b/tests/test_datasets/test_imagenet_dataset.py @@ -14,3 +14,8 @@ def test_load_data_list(self): with self.assertRaisesRegex( AssertionError, r"\(3\) doesn't match .* classes \(1000\)"): ImageNet(data_root=DATA_DIR, data_prefix=DATA_DIR) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_mscoco_dataset.py b/tests/test_datasets/test_mscoco_dataset.py index 35bc44d857..e5940cb498 100644 --- a/tests/test_datasets/test_mscoco_dataset.py +++ b/tests/test_datasets/test_mscoco_dataset.py @@ -29,3 +29,8 @@ def test_mscoco(self): img_path=os.path.join(self.data_root, 'val2014', 'COCO_val2014_000000000042.jpg'), sample_idx=0) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_paired_image_dataset.py b/tests/test_datasets/test_paired_image_dataset.py index 82f09baaee..614b227a1b 100644 --- a/tests/test_datasets/test_paired_image_dataset.py +++ b/tests/test_datasets/test_paired_image_dataset.py @@ -51,3 +51,8 @@ def test_paired_image_dataset(self): assert img.ndim == 3 img = dataset[0]['inputs']['img_b'] assert img.ndim == 3 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_singan_dataset.py b/tests/test_datasets/test_singan_dataset.py index 4b3636a848..984e77ff74 100644 --- a/tests/test_datasets/test_singan_dataset.py +++ b/tests/test_datasets/test_singan_dataset.py @@ -40,3 +40,8 @@ def test_singan_dataset(self): a = TestSinGANDataset() a.setup_class() a.test_singan_dataset() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_albumentations.py b/tests/test_datasets/test_transforms/test_albumentations.py index 052dc9c3df..ea5421eb4e 100644 --- a/tests/test_datasets/test_transforms/test_albumentations.py +++ b/tests/test_datasets/test_transforms/test_albumentations.py @@ -13,3 +13,8 @@ def test_albumentations(): ]) results = model(results) assert results['img'].shape == (4, 4, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_alpha.py b/tests/test_datasets/test_transforms/test_alpha.py index e1bfdcf46d..0e967e166e 100644 --- a/tests/test_datasets/test_transforms/test_alpha.py +++ b/tests/test_datasets/test_transforms/test_alpha.py @@ -84,3 +84,8 @@ def test_generate_soft_seg(): 'erode_iter_range=(1, 2), dilate_iter_range=(1, 2), ' 'blur_ksizes=[(11, 11)])') assert repr(generate_soft_seg) == repr_str + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_aug_frames.py b/tests/test_datasets/test_transforms/test_aug_frames.py index 652bdd2c65..1ad4008f6b 100644 --- a/tests/test_datasets/test_transforms/test_aug_frames.py +++ b/tests/test_datasets/test_transforms/test_aug_frames.py @@ -94,3 +94,8 @@ def test_temporal_reverse(self): np.testing.assert_almost_equal(results['lq'][0], img_lq1) np.testing.assert_almost_equal(results['lq'][1], img_lq2) np.testing.assert_almost_equal(results['gt'][0], img_gt) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_aug_pixel.py b/tests/test_datasets/test_transforms/test_aug_pixel.py index a621d14dc7..7278e060fe 100644 --- a/tests/test_datasets/test_transforms/test_aug_pixel.py +++ b/tests/test_datasets/test_transforms/test_aug_pixel.py @@ -264,3 +264,8 @@ def test_unsharp_masking(self): with pytest.raises(ValueError): unsharp_masking = UnsharpMasking( kernel_size=10, sigma=0, weight=0.5, threshold=10, keys=['gt']) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_aug_shape.py b/tests/test_datasets/test_transforms/test_aug_shape.py index 9b8cbf395f..c9d268ed88 100644 --- a/tests/test_datasets/test_transforms/test_aug_shape.py +++ b/tests/test_datasets/test_transforms/test_aug_shape.py @@ -369,3 +369,8 @@ def test_numpy_pad(): f'(keys={pad.keys}, padding={pad.padding}, kwargs={pad.kwargs})') assert str(pad) == repr_str + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_blur_kernels.py b/tests/test_datasets/test_transforms/test_blur_kernels.py index d9851d79ea..560665e11b 100644 --- a/tests/test_datasets/test_transforms/test_blur_kernels.py +++ b/tests/test_datasets/test_transforms/test_blur_kernels.py @@ -10,3 +10,8 @@ def test_blur_kernels(): for kernel_type in kernels: kernel = blur_kernels.random_mixed_kernels([kernel_type], [1], 5) assert kernel.shape == (5, 5) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_crop.py b/tests/test_datasets/test_transforms/test_crop.py index 2f4b456c33..da46212909 100644 --- a/tests/test_datasets/test_transforms/test_crop.py +++ b/tests/test_datasets/test_transforms/test_crop.py @@ -383,3 +383,8 @@ def test_instance_crop(): cropped_img = results['cropped_img'] assert len(cropped_img) == 0 assert len(cropped_img) <= 2 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_fgbg.py b/tests/test_datasets/test_transforms/test_fgbg.py index fc0107530d..3aa85b1bda 100644 --- a/tests/test_datasets/test_transforms/test_fgbg.py +++ b/tests/test_datasets/test_transforms/test_fgbg.py @@ -165,3 +165,8 @@ def test_random_load_resize_bg(): assert repr( random_load_bg) == f"RandomLoadResizeBg(bg_dir='{str(bg_dir)}')" + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_formatting.py b/tests/test_datasets/test_transforms/test_formatting.py index b1e146c204..3809a47d3e 100644 --- a/tests/test_datasets/test_transforms/test_formatting.py +++ b/tests/test_datasets/test_transforms/test_formatting.py @@ -105,3 +105,8 @@ def test_pack_inputs(): gt_bg_tensor = to_tensor(ori_results['bg']) gt_bg_tensor = gt_bg_tensor.permute(2, 0, 1) assert_tensor_equal(data_sample.gt_bg, gt_bg_tensor) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_generate_assistant.py b/tests/test_datasets/test_transforms/test_generate_assistant.py index c1f063ff16..5d5f2c55e3 100644 --- a/tests/test_datasets/test_transforms/test_generate_assistant.py +++ b/tests/test_datasets/test_transforms/test_generate_assistant.py @@ -74,3 +74,8 @@ def test_generate_facial_heatmap(): f'target_size={generate_heatmap.target_size}, ' + f'sigma={generate_heatmap.sigma}, ' f'use_cache={generate_heatmap.use_cache})') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_generate_frame_indices.py b/tests/test_datasets/test_transforms/test_generate_frame_indices.py index 7c84b09b10..8a79fd4301 100644 --- a/tests/test_datasets/test_transforms/test_generate_frame_indices.py +++ b/tests/test_datasets/test_transforms/test_generate_frame_indices.py @@ -233,3 +233,8 @@ def test_frame_index_generation_for_recurrent(self): frame_index_generator = GenerateSegmentIndices(interval_list=[1]) rlt = frame_index_generator(copy.deepcopy(results)) assert len(rlt['img_path']) == 100 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_get_masked_image.py b/tests/test_datasets/test_transforms/test_get_masked_image.py index bcb0e87e53..dafe6549ac 100644 --- a/tests/test_datasets/test_transforms/test_get_masked_image.py +++ b/tests/test_datasets/test_transforms/test_get_masked_image.py @@ -32,3 +32,8 @@ def test_masked_img(): assert results['ori_img_shape'] == img.shape assert results['img_channel_order'] == 'rgb' assert results['img_color_type'] == 'color' + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_loading.py b/tests/test_datasets/test_transforms/test_loading.py index 68ea8f6290..31423e8265 100644 --- a/tests/test_datasets/test_transforms/test_loading.py +++ b/tests/test_datasets/test_transforms/test_loading.py @@ -296,3 +296,8 @@ def test_load_mask(self): with pytest.raises(NotImplementedError): loader = LoadMask('xxxx', mask_config) results = loader(results) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_matlab_like_resize.py b/tests/test_datasets/test_transforms/test_matlab_like_resize.py index 162ff2a1b3..f15283ee8b 100644 --- a/tests/test_datasets/test_transforms/test_matlab_like_resize.py +++ b/tests/test_datasets/test_transforms/test_matlab_like_resize.py @@ -35,3 +35,8 @@ def test_matlab_like_resize(): assert repr(imresize) == imresize.__class__.__name__ \ + "(keys=['lq'], scale=None, output_shape=(6, 6), " \ + 'kernel=bicubic, kernel_width=4.0)' + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_normalization.py b/tests/test_datasets/test_transforms/test_normalization.py index 7e0420c78e..3a95212621 100644 --- a/tests/test_datasets/test_transforms/test_normalization.py +++ b/tests/test_datasets/test_transforms/test_normalization.py @@ -133,3 +133,8 @@ def test_rescale_to_zero_one(self): alpha / 255.) np.testing.assert_almost_equal(rescale_to_zero_one_results['alpha'][1], alpha_2 / 255.) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_random_degradations.py b/tests/test_datasets/test_transforms/test_random_degradations.py index ee45bdf9aa..6e37f056f1 100644 --- a/tests/test_datasets/test_transforms/test_random_degradations.py +++ b/tests/test_datasets/test_transforms/test_random_degradations.py @@ -451,3 +451,8 @@ def test_degradations_with_shuffle(): ] * 10 model = DegradationsWithShuffle(degradations=degradations, keys=['lq']) model(results) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_random_down_sampling.py b/tests/test_datasets/test_transforms/test_random_down_sampling.py index efc6f5b5fe..aaae0b6635 100644 --- a/tests/test_datasets/test_transforms/test_random_down_sampling.py +++ b/tests/test_datasets/test_transforms/test_random_down_sampling.py @@ -41,3 +41,8 @@ def test_random_down_sampling(): results3 = down_sampling3(inputs3) assert results3['img_channel_order'] == 'rgb' assert results3['img_color_type'] == 'color' + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_trimap.py b/tests/test_datasets/test_transforms/test_trimap.py index a4848e24d3..0da0c7a411 100644 --- a/tests/test_datasets/test_transforms/test_trimap.py +++ b/tests/test_datasets/test_transforms/test_trimap.py @@ -229,3 +229,8 @@ def test_transform_trimap(): 'transformed_trimap'].shape[:2] == dummy_trimap.shape repr_str = transform.__class__.__name__ assert repr(transform) == repr_str + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_transforms/test_values.py b/tests/test_datasets/test_transforms/test_values.py index cb350d4fb4..810f00b3b3 100644 --- a/tests/test_datasets/test_transforms/test_values.py +++ b/tests/test_datasets/test_transforms/test_values.py @@ -61,3 +61,8 @@ def test_set_value(self): assert new_results[key] == dictionary[key] assert repr(set_values) == ( set_values.__class__.__name__ + f'(dictionary={dictionary})') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_datasets/test_unpaired_image_dataset.py b/tests/test_datasets/test_unpaired_image_dataset.py index 3ec4a85689..80b0f731f5 100644 --- a/tests/test_datasets/test_unpaired_image_dataset.py +++ b/tests/test_datasets/test_unpaired_image_dataset.py @@ -59,3 +59,8 @@ def test_unpaired_image_dataset(self): assert img.ndim == 3 img = dataset[0]['inputs']['img_b'] assert img.ndim == 3 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_ema.py b/tests/test_engine/test_hooks/test_ema.py index 443f9b997e..86cf6665aa 100644 --- a/tests/test_engine/test_hooks/test_ema.py +++ b/tests/test_engine/test_hooks/test_ema.py @@ -252,3 +252,8 @@ def test_ema_hook_cuda(self): assert torch.equal(runner.model.module_a.a, torch.tensor([0.25, 0.5]).cuda()) assert torch.equal(ema_states['a'], torch.tensor([0.375, 0.75]).cuda()) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_iter_time_hook.py b/tests/test_engine/test_hooks/test_iter_time_hook.py index cdc7cf9d35..f73c8d9488 100644 --- a/tests/test_engine/test_hooks/test_iter_time_hook.py +++ b/tests/test_engine/test_hooks/test_iter_time_hook.py @@ -69,3 +69,8 @@ def test_after_iter(self): assert runner.message_hub.get_info('eta') == 10 self.hook._after_iter(runner, batch_idx=19, mode='test') assert runner.message_hub.get_info('eta') == 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py b/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py index 953cb1402d..6fb629c9db 100644 --- a/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py +++ b/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py @@ -131,3 +131,8 @@ def test_before_train_iter(self): runner.train_loop.dataloader = dataloader model._next_scale_int = 4 self.assertRaises(ValueError, hooks.before_train_iter, runner, 0, None) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_pickle_data_hook.py b/tests/test_engine/test_hooks/test_pickle_data_hook.py index 0ae46a0dc1..a60b7d9e91 100644 --- a/tests/test_engine/test_hooks/test_pickle_data_hook.py +++ b/tests/test_engine/test_hooks/test_pickle_data_hook.py @@ -41,3 +41,8 @@ def test_PickleDataHook(): # test before run hook.before_run(runner) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py b/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py index 84d1eba2e2..2761442ec2 100644 --- a/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py +++ b/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py @@ -113,3 +113,8 @@ def test_reduce_lr_scheduler_hook(): with pytest.raises(TypeError): runner.param_schedulers = '' hook.after_val_epoch(runner, metrics=dict(PSNR=50)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_hooks/test_visualization_hook.py b/tests/test_engine/test_hooks/test_visualization_hook.py index c55e6b5155..b26ebcd14c 100644 --- a/tests/test_engine/test_hooks/test_visualization_hook.py +++ b/tests/test_engine/test_hooks/test_visualization_hook.py @@ -616,3 +616,8 @@ def test_after_test_iter(self): hook.after_test_iter(runner, 0, [], outputs) assert mock_visualuzer.add_datasample.call_count == 3 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py index 38cac0ab72..c49ff9fcee 100644 --- a/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py @@ -137,3 +137,8 @@ def test_optimizer_constructor(): model = ToyModel2() optim_wrapper = optim_wrapper_constructor(model) assert isinstance(optim_wrapper, OptimWrapper) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py index d0f7ecff0b..1d8beed43b 100644 --- a/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py @@ -90,3 +90,8 @@ def test(self): self.assertTrue(all([id(gen_optims[0]) == id(o) for o in gen_optims])) self.assertTrue( all([id(disc_optims[0]) == id(o) for o in disc_optims])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py index fc38719ea0..e4364e3fa2 100644 --- a/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py @@ -60,3 +60,8 @@ def test(self): with self.assertRaises(AssertionError): optim_wrapper_dict_builder = SinGANOptimWrapperConstructor( self.optim_wrapper_cfg, 'test') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_runner/test_log_processor.py b/tests/test_engine/test_runner/test_log_processor.py index 90db3b494a..3e633d4685 100644 --- a/tests/test_engine/test_runner/test_log_processor.py +++ b/tests/test_engine/test_runner/test_log_processor.py @@ -26,3 +26,8 @@ def test_get_dataloader_size(self): assert log_processor._get_dataloader_size(self.runner, 'train') == 20 assert log_processor._get_dataloader_size(self.runner, 'val') == 10 assert log_processor._get_dataloader_size(self.runner, 'test') == 5 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_runner/test_loop_utils.py b/tests/test_engine/test_runner/test_loop_utils.py index 4a11cccb96..6e357661c2 100644 --- a/tests/test_engine/test_runner/test_loop_utils.py +++ b/tests/test_engine/test_runner/test_loop_utils.py @@ -62,3 +62,8 @@ def test_update_and_check_evaluator(): evaluator = dict(type='Evaluator') evaluator = update_and_check_evaluator(evaluator) assert evaluator['metrics'] is None + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_runner/test_multi_loops.py b/tests/test_engine/test_runner/test_multi_loops.py index 6c3e42d9d3..327cc06e99 100644 --- a/tests/test_engine/test_runner/test_multi_loops.py +++ b/tests/test_engine/test_runner/test_multi_loops.py @@ -205,3 +205,8 @@ def _test_run(self, is_val): def test_run(self): self._test_run(True) # val self._test_run(False) # test + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py b/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py index a65489ebe4..0bd46a7fb4 100644 --- a/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py +++ b/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py @@ -54,3 +54,8 @@ def test_step(self): param_scheduler.step() np.testing.assert_almost_equal(param_scheduler._get_value(), targets[step].item()) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py b/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py index 33c969b2b8..2e4cececa9 100644 --- a/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py +++ b/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py @@ -105,3 +105,8 @@ def test_reduce_lr_scheduler(self): ReduceLR(self.optimizer, threshold_mode='ysli') with pytest.raises(ValueError): ReduceLR(self.optimizer, factor=1.5) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_evaluator.py b/tests/test_evaluation/test_evaluator.py index da8960d9df..602564fd8d 100644 --- a/tests/test_evaluation/test_evaluator.py +++ b/tests/test_evaluation/test_evaluator.py @@ -208,3 +208,8 @@ def test_evalute(self): evaluator = Evaluator(None) output = evaluator.evaluate() self.assertEqual(output, {'No Metric': 'Nan'}) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_functional/test_fid_inception.py b/tests/test_evaluation/test_functional/test_fid_inception.py index ef55d96f59..7996bc3c80 100644 --- a/tests/test_evaluation/test_functional/test_fid_inception.py +++ b/tests/test_evaluation/test_functional/test_fid_inception.py @@ -41,3 +41,8 @@ def test_load_fid_inception(): inputs = torch.randn(1, 3, 299, 299) outputs = fid_net(inputs) assert outputs.shape == (1, 1008) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_functional/test_gaussian_funcs.py b/tests/test_evaluation/test_functional/test_gaussian_funcs.py index fa3d6e7654..0014ca2918 100644 --- a/tests/test_evaluation/test_functional/test_gaussian_funcs.py +++ b/tests/test_evaluation/test_functional/test_gaussian_funcs.py @@ -8,3 +8,8 @@ def test_gauss_gradient(): img = np.random.randint(0, 255, size=(8, 8, 3)) grad = gauss_gradient(img, 1.4) assert grad.shape == (8, 8, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_functional/test_inception_utils.py b/tests/test_evaluation/test_functional/test_inception_utils.py index 2eeb26103b..0e38a470e3 100644 --- a/tests/test_evaluation/test_functional/test_inception_utils.py +++ b/tests/test_evaluation/test_functional/test_inception_utils.py @@ -64,3 +64,8 @@ def test_vgg_feat_cache_name_args(): # check whether cache name are same with the same inputs assert cache_tag_1 == cache_tag_2 assert args_1 == args_2 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_base_gen_metric.py b/tests/test_evaluation/test_metrics/test_base_gen_metric.py index 6937fec3b0..db08a54170 100644 --- a/tests/test_evaluation/test_metrics/test_base_gen_metric.py +++ b/tests/test_evaluation/test_metrics/test_base_gen_metric.py @@ -117,3 +117,8 @@ def side_effect(index): output = next(iterator) assert output['inputs'] == dict( sample_model='ema', num_batches=10, sample_kwargs=sample_kwargs) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py b/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py index 41c4e8a9c1..4727b73d5b 100644 --- a/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py +++ b/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py @@ -88,3 +88,8 @@ def test_prepare(): metric.get_metric_sampler(None, dataloader, []) assert dataloader == dataloader + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_connectivity_error.py b/tests/test_evaluation/test_metrics/test_connectivity_error.py index 573a32977c..a296910664 100644 --- a/tests/test_evaluation/test_metrics/test_connectivity_error.py +++ b/tests/test_evaluation/test_metrics/test_connectivity_error.py @@ -104,3 +104,8 @@ def test_connectivity_error(self): assert list(res.keys()) == ['ConnectivityError'] assert np.allclose(res['ConnectivityError'], 0.256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_equivariance.py b/tests/test_evaluation/test_metrics/test_equivariance.py index d6268d8996..f03cfc2c9f 100644 --- a/tests/test_evaluation/test_metrics/test_equivariance.py +++ b/tests/test_evaluation/test_metrics/test_equivariance.py @@ -67,3 +67,8 @@ def test_eq_cuda(self): eq_res = eq.compute_metrics(eq.fake_results) isinstance(eq_res['eqt_int'], float) and isinstance( eq_res['eqt_frac'], float) and isinstance(eq_res['eqr'], float) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_fid.py b/tests/test_evaluation/test_metrics/test_fid.py index 26572a2825..d649b51096 100644 --- a/tests/test_evaluation/test_metrics/test_fid.py +++ b/tests/test_evaluation/test_metrics/test_fid.py @@ -277,3 +277,8 @@ def test_trans_fid_cpu(self): fid_res = fid.compute_metrics(fid.fake_results) assert fid_res['fid'] >= 0 and fid_res['mean'] >= 0 and fid_res[ 'cov'] >= 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_gradient_error.py b/tests/test_evaluation/test_metrics/test_gradient_error.py index bcd75df578..8dc4a74811 100644 --- a/tests/test_evaluation/test_metrics/test_gradient_error.py +++ b/tests/test_evaluation/test_metrics/test_gradient_error.py @@ -101,3 +101,8 @@ def test_gradient_error(self): assert list(res.keys()) == ['GradientError'] np.testing.assert_almost_equal(el['grad_err'], 0.0028887) # assert np.allclose(res['GradientError'], 0.0028887) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_inception_score.py b/tests/test_evaluation/test_metrics/test_inception_score.py index 67c433c915..b097bd2f38 100644 --- a/tests/test_evaluation/test_metrics/test_inception_score.py +++ b/tests/test_evaluation/test_metrics/test_inception_score.py @@ -230,3 +230,8 @@ def test_trans_is_cpu(self): IS.process(_data_batch, _predictions) IS_res = IS.compute_metrics(IS.fake_results) assert 'is' in IS_res and 'is_std' in IS_res + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_mae.py b/tests/test_evaluation/test_metrics/test_mae.py index 9bbe0816a4..23683e41ac 100644 --- a/tests/test_evaluation/test_metrics/test_mae.py +++ b/tests/test_evaluation/test_metrics/test_mae.py @@ -49,3 +49,8 @@ def test_mae(self): result = mae.compute_metrics(mae.results) assert 'MAE' in result np.testing.assert_almost_equal(result['MAE'], 0.003921568627) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_matting_mse.py b/tests/test_evaluation/test_metrics/test_matting_mse.py index c17ec511db..4a57c27fe6 100644 --- a/tests/test_evaluation/test_metrics/test_matting_mse.py +++ b/tests/test_evaluation/test_metrics/test_matting_mse.py @@ -104,3 +104,8 @@ def test_mse(self): assert list(res.keys()) == ['MattingMSE'] np.testing.assert_almost_equal(res['MattingMSE'], 3.0) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_metrics_utils.py b/tests/test_evaluation/test_metrics/test_metrics_utils.py index 3bd3adf5c3..702b156943 100644 --- a/tests/test_evaluation/test_metrics/test_metrics_utils.py +++ b/tests/test_evaluation/test_metrics/test_metrics_utils.py @@ -49,3 +49,8 @@ def test_reorder_image(): output = reorder_image(img_chw, input_order='CHW') assert output.shape == (32, 32, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_ms_ssim.py b/tests/test_evaluation/test_metrics/test_ms_ssim.py index c3278a5028..33f1e7d733 100644 --- a/tests/test_evaluation/test_metrics/test_ms_ssim.py +++ b/tests/test_evaluation/test_metrics/test_ms_ssim.py @@ -62,3 +62,8 @@ def test_process_and_evaluate(self): # test prefix MS_SSIM = MultiScaleStructureSimilarity( fake_nums=4, fake_key='fake', sample_model='ema', prefix='ms-ssim') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_mse.py b/tests/test_evaluation/test_metrics/test_mse.py index c0aabb8f78..e5cded9fbe 100644 --- a/tests/test_evaluation/test_metrics/test_mse.py +++ b/tests/test_evaluation/test_metrics/test_mse.py @@ -49,3 +49,8 @@ def test_mse(self): result = mae.compute_metrics(mae.results) assert 'MSE' in result np.testing.assert_almost_equal(result['MSE'], 0.000015378700496) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_niqe.py b/tests/test_evaluation/test_metrics/test_niqe.py index ac757172f2..1949e3d33f 100644 --- a/tests/test_evaluation/test_metrics/test_niqe.py +++ b/tests/test_evaluation/test_metrics/test_niqe.py @@ -80,3 +80,8 @@ def test_calculate_niqe(): input_order='CHW', convert_to='y') np.testing.assert_almost_equal(result, 6.10074, decimal=5) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_ppl.py b/tests/test_evaluation/test_metrics/test_ppl.py index 9d0c3d1ade..1e320bc8f7 100644 --- a/tests/test_evaluation/test_metrics/test_ppl.py +++ b/tests/test_evaluation/test_metrics/test_ppl.py @@ -125,3 +125,8 @@ def test_ppl_cpu(self): ppl.process(_data_batch, _predictions) ppl_res = ppl.compute_metrics(ppl.fake_results) assert ppl_res['ppl_score'] >= 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_precision_and_recall.py b/tests/test_evaluation/test_metrics/test_precision_and_recall.py index c533a895d1..e0387d6261 100644 --- a/tests/test_evaluation/test_metrics/test_precision_and_recall.py +++ b/tests/test_evaluation/test_metrics/test_precision_and_recall.py @@ -97,3 +97,8 @@ def test_pr_cpu(self): pr_score = pr.evaluate() print(pr_score) assert pr_score['precision'] >= 0 and pr_score['recall'] >= 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_psnr.py b/tests/test_evaluation/test_metrics/test_psnr.py index 069a6b870e..215ce97f3c 100644 --- a/tests/test_evaluation/test_metrics/test_psnr.py +++ b/tests/test_evaluation/test_metrics/test_psnr.py @@ -86,3 +86,8 @@ def test_psnr(): img_hw_2 = np.ones((32, 32), dtype=np.uint8) * 255 psnr_result = psnr(img_hw_1, img_hw_2, crop_border=0) assert psnr_result == 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_sad.py b/tests/test_evaluation/test_metrics/test_sad.py index cf61ba166a..232ddeba4a 100644 --- a/tests/test_evaluation/test_metrics/test_sad.py +++ b/tests/test_evaluation/test_metrics/test_sad.py @@ -104,3 +104,8 @@ def test_sad(self): assert list(res.keys()) == ['SAD'] np.testing.assert_almost_equal(res['SAD'], 0.768) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_snr.py b/tests/test_evaluation/test_metrics/test_snr.py index e1016869f1..0d6fb8f2da 100644 --- a/tests/test_evaluation/test_metrics/test_snr.py +++ b/tests/test_evaluation/test_metrics/test_snr.py @@ -88,3 +88,8 @@ def test_snr(): img_hw_2 = np.zeros((32, 32), dtype=np.uint8) snr_result = snr(img_hw_1, img_hw_2, crop_border=0) assert snr_result == 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_ssim.py b/tests/test_evaluation/test_metrics/test_ssim.py index faaf0f4bae..1e670a3d92 100644 --- a/tests/test_evaluation/test_metrics/test_ssim.py +++ b/tests/test_evaluation/test_metrics/test_ssim.py @@ -74,3 +74,8 @@ def test_calculate_ssim(): np.testing.assert_almost_equal(ssim_result, 0.9130623) ssim_result = ssim(img_hwc_1, img_hwc_2, crop_border=0, convert_to='Y') np.testing.assert_almost_equal(ssim_result, 0.9987801) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_evaluation/test_metrics/test_swd.py b/tests/test_evaluation/test_metrics/test_swd.py index b953385bdb..8798e876be 100644 --- a/tests/test_evaluation/test_metrics/test_swd.py +++ b/tests/test_evaluation/test_metrics/test_swd.py @@ -85,3 +85,8 @@ def test_prosess(self): swd.process(None, fake_samples) # fake_nums is -1, all samples (10 * 3 = 30) is processed self.assertEqual(swd._num_processed, 30) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_aspp.py b/tests/test_models/test_archs/test_aspp.py index 578327dec4..edd861eca8 100644 --- a/tests/test_models/test_archs/test_aspp.py +++ b/tests/test_models/test_archs/test_aspp.py @@ -31,3 +31,8 @@ def test_aspp(): x = torch.rand(2, 128, 8, 8) output = aspp(x) assert output.shape == (2, 256, 8, 8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_conv.py b/tests/test_models/test_archs/test_conv.py index 691d1e489a..07dd8e9ed1 100644 --- a/tests/test_models/test_archs/test_conv.py +++ b/tests/test_models/test_archs/test_conv.py @@ -4,3 +4,8 @@ def test_conv(): assert 'Deconv' in conv.MODELS.module_dict + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_downsample.py b/tests/test_models/test_archs/test_downsample.py index 5929ae9d61..ae445d5d18 100644 --- a/tests/test_models/test_archs/test_downsample.py +++ b/tests/test_models/test_archs/test_downsample.py @@ -21,3 +21,8 @@ def test_pixel_unshuffle(): with pytest.raises(AssertionError): y = pixel_unshuffle(x, scale=3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_ensemble.py b/tests/test_models/test_archs/test_ensemble.py index 717667a716..b9f9ac5931 100644 --- a/tests/test_models/test_archs/test_ensemble.py +++ b/tests/test_models/test_archs/test_ensemble.py @@ -65,3 +65,8 @@ def test_ensemble_cuda(): ensemble = SpatialTemporalEnsemble(is_temporal_ensemble=True) inputs = torch.rand(1, 3, 4, 4).cuda() outputs = ensemble(inputs, model) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_gated_conv_module.py b/tests/test_models/test_archs/test_gated_conv_module.py index 6092041392..0f7af1c618 100644 --- a/tests/test_models/test_archs/test_gated_conv_module.py +++ b/tests/test_models/test_archs/test_gated_conv_module.py @@ -33,3 +33,8 @@ def test_gated_conv(): assert conv.conv.out_channels == 20 out = conv(x) assert out.shape == (2, 10, 10, 10) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_img_normalize.py b/tests/test_models/test_archs/test_img_normalize.py index 4bfc8c9ffd..11287fb433 100644 --- a/tests/test_models/test_archs/test_img_normalize.py +++ b/tests/test_models/test_archs/test_img_normalize.py @@ -20,3 +20,8 @@ def test_normalize_layer(): std_y = y.std(dim=1) assert sum(torch.div(std_x, std_y) - rgb_std) < 1e-5 assert sum(torch.div(mean_x - rgb_mean, rgb_std) - mean_y) < 1e-5 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_linear_module.py b/tests/test_models/test_archs/test_linear_module.py index f7d518118e..9348000035 100644 --- a/tests/test_models/test_archs/test_linear_module.py +++ b/tests/test_models/test_archs/test_linear_module.py @@ -46,3 +46,8 @@ def test_linear_module(): order=('act', 'linear')) assert linear.order == ('act', 'linear') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_lora.py b/tests/test_models/test_archs/test_lora.py index 5e821defb4..20e93de046 100644 --- a/tests/test_models/test_archs/test_lora.py +++ b/tests/test_models/test_archs/test_lora.py @@ -126,3 +126,8 @@ def test_set_lora(): set_lora_enable(model) out_lora_enable = model(img, context) assert (out_lora_enable == out_w_lora).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_multi_layer_disc.py b/tests/test_models/test_archs/test_multi_layer_disc.py index 3372e32c09..24f6420029 100644 --- a/tests/test_models/test_archs/test_multi_layer_disc.py +++ b/tests/test_models/test_archs/test_multi_layer_disc.py @@ -85,3 +85,8 @@ def test_multi_layer_disc(): assert not multi_disc.conv5.with_norm assert not multi_disc.conv5.with_activation assert multi_disc.conv5.stride == (1, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_patch_disc.py b/tests/test_models/test_archs/test_patch_disc.py index 39fd32a28d..3d2408af23 100644 --- a/tests/test_models/test_archs/test_patch_disc.py +++ b/tests/test_models/test_archs/test_patch_disc.py @@ -59,3 +59,8 @@ def test_patch_discriminator(): bad_cfg['norm_cfg'] = dict(tp='BN') with pytest.raises(AssertionError): _ = MODELS.build(bad_cfg) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_resnet.py b/tests/test_models/test_archs/test_resnet.py index 0ce5605f67..823ccc9324 100644 --- a/tests/test_models/test_archs/test_resnet.py +++ b/tests/test_models/test_archs/test_resnet.py @@ -16,3 +16,8 @@ def test_resnet(): input = torch.rand((2, 3, 128, 128)) output = resnet(input) assert output[0].detach().numpy().shape == (2, 3, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_separable_conv_module.py b/tests/test_models/test_archs/test_separable_conv_module.py index 1f975c629f..0b9a7259f1 100644 --- a/tests/test_models/test_archs/test_separable_conv_module.py +++ b/tests/test_models/test_archs/test_separable_conv_module.py @@ -70,3 +70,8 @@ def test_depthwise_separable_conv(): assert conv.pointwise_conv.activate.__class__.__name__ == 'LeakyReLU' output = conv(x) assert output.shape == (1, 8, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_simple_encoder_decoder.py b/tests/test_models/test_archs/test_simple_encoder_decoder.py index 3a546bd533..fd6a5557d4 100644 --- a/tests/test_models/test_archs/test_simple_encoder_decoder.py +++ b/tests/test_models/test_archs/test_simple_encoder_decoder.py @@ -87,3 +87,8 @@ def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): alpha = alpha.cuda() trimap = trimap.cuda() return fg, bg, merged, alpha, trimap + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_smpatch_disc.py b/tests/test_models/test_archs/test_smpatch_disc.py index dd33fa9f03..8449e52771 100644 --- a/tests/test_models/test_archs/test_smpatch_disc.py +++ b/tests/test_models/test_archs/test_smpatch_disc.py @@ -45,3 +45,8 @@ def test_smpatch_discriminator(): net = net.cuda() output = net(img.cuda()) assert output.shape == (1, 1, 6, 6) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_sr_backbone.py b/tests/test_models/test_archs/test_sr_backbone.py index 13ed5c0583..0b68cfc1d7 100644 --- a/tests/test_models/test_archs/test_sr_backbone.py +++ b/tests/test_models/test_archs/test_sr_backbone.py @@ -10,3 +10,8 @@ def test_sr_backbone_utils(): input = torch.rand((2, 64, 128, 128)) output = block(input) assert output.detach().numpy().shape == (2, 64, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_tokenizer.py b/tests/test_models/test_archs/test_tokenizer.py index 4aad1b6cd2..f3096aede2 100644 --- a/tests/test_models/test_archs/test_tokenizer.py +++ b/tests/test_models/test_archs/test_tokenizer.py @@ -46,3 +46,8 @@ def test_encode_and_decode_and_call(self): for idx in range(4): self.assertIn(f'ngapi_{idx}', text_recon_raw) self.assertEqual(input_ids, self.tokenizer(text).input_ids) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_upsample.py b/tests/test_models/test_archs/test_upsample.py index 4e1c605ac0..34aea00cf0 100644 --- a/tests/test_models/test_archs/test_upsample.py +++ b/tests/test_models/test_archs/test_upsample.py @@ -19,3 +19,8 @@ def test_pixel_shuffle(): x = x.cuda() y = model(x) assert y.shape == (1, 3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_vgg.py b/tests/test_models/test_archs/test_vgg.py index 78fdb74afd..a271d34be6 100644 --- a/tests/test_models/test_archs/test_vgg.py +++ b/tests/test_models/test_archs/test_vgg.py @@ -129,3 +129,8 @@ def test_vgg16_encoder(): assert_tensor_with_shape(outputs['max_idx_4'], target_shape[3]) assert_tensor_with_shape(outputs['max_idx_5'], target_shape[4]) assert check_norm_state(model.modules(), True) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_archs/test_wrapper.py b/tests/test_models/test_archs/test_wrapper.py index e7a3cdb2b0..c5f2626fa7 100644 --- a/tests/test_models/test_archs/test_wrapper.py +++ b/tests/test_models/test_archs/test_wrapper.py @@ -109,3 +109,8 @@ def test_build(self): model.registrer_buffer('buffer', 123) called_args, _ = register_buffer_mock.call_args self.assertEqual(called_args, ('buffer', 123)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_average_model.py b/tests/test_models/test_base_models/test_average_model.py index ec66d3039b..289a391af1 100644 --- a/tests/test_models/test_base_models/test_average_model.py +++ b/tests/test_models/test_base_models/test_average_model.py @@ -217,3 +217,8 @@ def test_load_from_state_dict(self): missing_keys=[], unexpected_keys=[], error_msgs=[]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_base_conditional_gan.py b/tests/test_models/test_base_models/test_base_conditional_gan.py index ee1b888787..7394ecde12 100644 --- a/tests/test_models/test_base_models/test_base_conditional_gan.py +++ b/tests/test_models/test_base_models/test_base_conditional_gan.py @@ -287,3 +287,8 @@ def test_custom_loss(self): self.assertIn('loss_disc_fake_g', log_vars) self.assertNotIn('loss_gen_aux', log_vars) self.assertNotIn('loss_disc_shift', log_vars) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_base_edit_model.py b/tests/test_models/test_base_models/test_base_edit_model.py index e6c01f302e..c9ea0469aa 100644 --- a/tests/test_models/test_base_models/test_base_edit_model.py +++ b/tests/test_models/test_base_models/test_base_edit_model.py @@ -64,3 +64,8 @@ def test_base_edit_model(): # feat output = model(torch.rand(1, 3, 20, 20), mode='tensor') assert output.shape == (1, 3, 20, 20) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_base_gan.py b/tests/test_models/test_base_models/test_base_gan.py index 7523106c2b..7d612d0925 100644 --- a/tests/test_models/test_base_models/test_base_gan.py +++ b/tests/test_models/test_base_models/test_base_gan.py @@ -427,3 +427,8 @@ def test_gather_log_vars(self): # test raise error with self.assertRaises(AssertionError): gan.gather_log_vars([dict(a=1), dict(b=2)]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_base_mattor.py b/tests/test_models/test_base_models/test_base_mattor.py index 6779b655a1..db4ffa3ccc 100644 --- a/tests/test_models/test_base_models/test_base_mattor.py +++ b/tests/test_models/test_base_models/test_base_mattor.py @@ -461,3 +461,8 @@ def test_gca(): model.cpu().eval() inputs = torch.ones((1, 4, 32, 32)) model.forward(inputs) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_base_translation_model.py b/tests/test_models/test_base_models/test_base_translation_model.py index c5123369d2..f773f8e769 100644 --- a/tests/test_models/test_base_models/test_base_translation_model.py +++ b/tests/test_models/test_base_models/test_base_translation_model.py @@ -70,3 +70,8 @@ def test_forward(self): img=torch.randn(1, 3, 64, 64), target_domain=None) self.assertEqual(res['target'].shape, (1, 3, 64, 64)) self.assertEqual(res['source'].shape, (1, 3, 64, 64)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_basic_interpolator.py b/tests/test_models/test_base_models/test_basic_interpolator.py index 8e963af53b..1c04427b53 100644 --- a/tests/test_models/test_base_models/test_basic_interpolator.py +++ b/tests/test_models/test_base_models/test_basic_interpolator.py @@ -39,3 +39,8 @@ def test_basic_interpolator(): result = model.merge_frames(input_tensors, output_tensors) assert len(result) == 17 assert result[0].shape == (16, 16, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_one_stage.py b/tests/test_models/test_base_models/test_one_stage.py index b71ae1d976..fd662e9bee 100644 --- a/tests/test_models/test_base_models/test_one_stage.py +++ b/tests/test_models/test_base_models/test_one_stage.py @@ -101,3 +101,8 @@ def test_one_stage_inpaintor(): assert inpaintor.train_cfg.disc_step == 2 log_vars = inpaintor.train_step(data_batch, optim_dict) assert 'loss_l1_hole' not in log_vars + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_base_models/test_two_stage.py b/tests/test_models/test_base_models/test_two_stage.py index bf04c52b6c..f431b33f12 100644 --- a/tests/test_models/test_base_models/test_two_stage.py +++ b/tests/test_models/test_base_models/test_two_stage.py @@ -109,3 +109,8 @@ def test_two_stage_inpaintor(): assert 'stage1_loss_l1_valid' in log_vars assert 'stage2_loss_l1_hole' in log_vars assert 'stage2_loss_l1_valid' in log_vars + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_data_preprocessors/test_data_preprocessor.py b/tests/test_models/test_data_preprocessors/test_data_preprocessor.py index ce7e2523f6..c40b413b20 100644 --- a/tests/test_models/test_data_preprocessors/test_data_preprocessor.py +++ b/tests/test_models/test_data_preprocessors/test_data_preprocessor.py @@ -876,3 +876,8 @@ def test_destruct(self): destruct_batch = data_preprocessor.destruct(inputs) self.assertEqual(destruct_batch.shape, (2, 1, 5, 5)) assert_allclose(destruct_batch.float(), inputs.float()) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py b/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py index 2a197277f8..561ac842f0 100644 --- a/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py +++ b/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py @@ -54,3 +54,8 @@ def test_mattor_preprocessor(): data = dict(inputs=inputs, data_samples=[data_sample]) data = processor(data, training=False) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py b/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py index a7cfc07817..b490aca185 100644 --- a/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py +++ b/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py @@ -50,3 +50,8 @@ def test_ddim_step(): if __name__ == '__main__': test_ddim_step() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_diffusion_schedulers/test_init.py b/tests/test_models/test_diffusion_schedulers/test_init.py index b8ab67e6c7..548ec5e263 100644 --- a/tests/test_models/test_diffusion_schedulers/test_init.py +++ b/tests/test_models/test_diffusion_schedulers/test_init.py @@ -46,3 +46,8 @@ def test_build(self): # tear down shutil.rmtree(config_path) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py index 014d7b1ad1..8cf924a915 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py @@ -16,3 +16,8 @@ def test_gl_dec(): aot_encdec = MODELS.build(cfg_) output = aot_encdec(input_x) assert output.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py index 98566322ef..351f965ffc 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py @@ -16,3 +16,8 @@ def test_gl_enc(): aot_encdec = MODELS.build(cfg_) output = aot_encdec(input_x) assert output.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py index 920c3d6665..565f843119 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py @@ -34,3 +34,8 @@ def test_gl_encdec(): aot_encdec = aot_encdec.cuda() output = aot_encdec(input_x.cuda()) assert output.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py b/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py index d26462d3c1..ffa1fc7964 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py @@ -74,3 +74,8 @@ def test_aot_inpaintor(): assert 'fake_img' in prediction assert 'pred_img' in prediction assert prediction.pred_img.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_neck.py b/tests/test_models/test_editors/test_aotgan/test_aot_neck.py index 3eadb50e50..df7a702f36 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_neck.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_neck.py @@ -18,3 +18,8 @@ def test_aot_dilation_neck(): x = torch.rand((2, 32, 64, 64)).cuda() res = neck(x) assert res.shape == (2, 32, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_arcface/test_arcface_modules.py b/tests/test_models/test_editors/test_arcface/test_arcface_modules.py index a26322752c..7c180e90d6 100644 --- a/tests/test_models/test_editors/test_arcface/test_arcface_modules.py +++ b/tests/test_models/test_editors/test_arcface/test_arcface_modules.py @@ -19,3 +19,8 @@ def test_get_blocks(): assert len(blocks) == 4 with pytest.raises(ValueError): get_blocks(num_layers=1000) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_arcface/test_id_loss.py b/tests/test_models/test_editors/test_arcface/test_id_loss.py index c07130db65..3a9e8f94d8 100644 --- a/tests/test_models/test_editors/test_arcface/test_id_loss.py +++ b/tests/test_models/test_editors/test_arcface/test_id_loss.py @@ -37,3 +37,8 @@ def test_arcface_cuda(self): x2 = torch.randn((2, 3, 224, 224)).cuda() y, _ = id_loss_model(pred=x1, gt=x2) assert y >= 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_arcface/test_model_irse.py b/tests/test_models/test_editors/test_arcface/test_model_irse.py index b8f35067a2..90c4215304 100644 --- a/tests/test_models/test_editors/test_arcface/test_model_irse.py +++ b/tests/test_models/test_editors/test_arcface/test_model_irse.py @@ -114,3 +114,8 @@ def test_arcface_cuda(self): x = torch.randn((2, 3, 224, 224)).cuda() y = model(x) assert y.shape == (2, 512) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py b/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py index 4b2f345830..8c1ea4a0b6 100644 --- a/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py +++ b/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py @@ -79,3 +79,8 @@ def test_basicvsr(): train_cfg=dict(fix_iter=1), ensemble=dict(type=''), data_preprocessor=DataPreprocessor()) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py b/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py index 3f7939086e..aa85958ad4 100644 --- a/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py +++ b/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py @@ -27,3 +27,8 @@ def test_basicvsr_net(): input_tensor = torch.rand(1, 5, 3, 16, 16).cuda() output = basicvsr(input_tensor) assert output.shape == (1, 5, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py b/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py index b1f4bae575..6e1d31b79a 100644 --- a/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py +++ b/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py @@ -92,3 +92,8 @@ def test_basicvsr_plusplus_cuda(): input_tensor = torch.rand(1, 5, 3, 256, 256).cuda() output = model(input_tensor) assert output.shape == (1, 5, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan.py b/tests/test_models/test_editors/test_biggan/test_biggan.py index 665cea0a66..4c7058b02a 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan.py @@ -132,3 +132,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py b/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py index 4cb169eb23..f6eaaad776 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py @@ -103,3 +103,8 @@ def test_biggan_deep_discriminator_cuda(self): d = MODELS.build(cfg).cuda() y = d(self.x.cuda(), self.label.cuda()) assert y.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py b/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py index d08304d68e..6319d15704 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py @@ -228,3 +228,8 @@ def test_biggan_deep_generator_cuda(self): g = MODELS.build(cfg).cuda() res = g(None, None, num_batches=3) assert res.shape == (3, 3, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py b/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py index 845744ada9..28323893ea 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py @@ -120,3 +120,8 @@ def test_biggan_discriminator_cuda(self): d = MODELS.build(cfg).cuda() y = d(self.x.cuda(), self.label.cuda()) assert y.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_generator.py b/tests/test_models/test_editors/test_biggan/test_biggan_generator.py index 9b781629d5..9241c32c50 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_generator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_generator.py @@ -232,3 +232,8 @@ def test_biggan_generator_cuda(self): cfg.update(dict(init_cfg=dict(type='ortho'))) g = MODELS.build(cfg) g.init_weights() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_modules.py b/tests/test_models/test_editors/test_biggan/test_biggan_modules.py index 322a0b036c..687db7f4b7 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_modules.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_modules.py @@ -434,3 +434,8 @@ def test_biggan_disc_res_block_cuda(self): module = MODELS.build(cfg).cuda() out = module(self.x.cuda()) assert out.shape == (2, 64, 8, 8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py b/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py index e6732a4205..776bb4fd60 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py @@ -32,3 +32,8 @@ def test_SpectralNorm(): x = torch.randn(1, 4) out = sn_block(x) assert out.shape == (1, 4) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_cain/test_cain.py b/tests/test_models/test_editors/test_cain/test_cain.py index 830cbcce0c..43ebc9a217 100644 --- a/tests/test_models/test_editors/test_cain/test_cain.py +++ b/tests/test_models/test_editors/test_cain/test_cain.py @@ -126,3 +126,8 @@ def test_cain(): # feat output = model(torch.rand(1, 2, 3, 32, 32), mode='tensor') assert output.shape == (1, 3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_cain/test_cain_net.py b/tests/test_models/test_editors/test_cain/test_cain_net.py index 50114cf90f..3149034bca 100644 --- a/tests/test_models/test_editors/test_cain/test_cain_net.py +++ b/tests/test_models/test_editors/test_cain/test_cain_net.py @@ -81,3 +81,8 @@ def test_cain_net_cuda(): with pytest.raises(ValueError): model_cfg = dict(type='CAINNet', norm='lys') MODELS.build(model_cfg).cuda() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_controlnet/test_controlnet.py b/tests/test_models/test_editors/test_controlnet/test_controlnet.py index d29bc1ebcf..9d9ba7baf7 100644 --- a/tests/test_models/test_editors/test_controlnet/test_controlnet.py +++ b/tests/test_models/test_editors/test_controlnet/test_controlnet.py @@ -224,3 +224,8 @@ def forward(self, *args, **kwargs): control_sd.text_encoder = mock_text_encoder() control_sd.train_step(data, optim_wrapper) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py b/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py index 198203522d..a8cafe5339 100644 --- a/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py +++ b/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py @@ -67,3 +67,8 @@ def test_change_base_model(): with pytest.raises(Exception): change_base_model(controlnet, currmodel, wrong_model) # change_base_model(controlnet, currmodel, wrong_base_state_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py index 3727245aa0..3c83a34c49 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py @@ -330,3 +330,8 @@ def test_cyclegan(): assert len(out) == 1 assert out[0].fake_photo.data.shape == (3, 64, 64) assert out[0].fake_mask.data.shape == (3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py index 223e13bbd8..093a4e3c57 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py @@ -53,3 +53,8 @@ def test_cyclegan_generator_cuda(self): gen = ResnetGenerator(**cfg).cuda() fake_b = gen(real_a) assert fake_b.shape == (2, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py index 56798452ab..479b1db2be 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py @@ -74,3 +74,8 @@ def test_gan_image_buffer(): and torch.equal(buffer.image_buffer[0], img_tensor_0)) or \ (torch.equal(img_tensor_return, img_tensor_00) and torch.equal(buffer.image_buffer[0], img_tensor_1)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan.py b/tests/test_models/test_editors/test_dcgan/test_dcgan.py index 351600545c..4aaee972dd 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan.py @@ -95,3 +95,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py b/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py index a9fc124b97..123c94324c 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py @@ -55,3 +55,8 @@ def test_dcgan_discriminator(self): assert not d.output_layer.with_norm assert not d.output_layer.with_activation assert isinstance(d.downsamples[1].activate, torch.nn.LeakyReLU) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py b/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py index 60cc2477c6..b0587bd31f 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py @@ -95,3 +95,8 @@ def test_dcgan_generator(self): _ = g(None) results = g(self.noise, return_noise=True) assert results['noise_batch'].shape == (2, 100, 1, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_attention.py b/tests/test_models/test_editors/test_ddpm/test_attention.py index f1368503ee..892ac376de 100644 --- a/tests/test_models/test_editors/test_ddpm/test_attention.py +++ b/tests/test_models/test_editors/test_ddpm/test_attention.py @@ -37,3 +37,8 @@ def test_FeedForward(): feed_forward = FeedForward(64, 64, activation_fn='geglu-approximate') output = feed_forward.forward(input) assert output.shape == (2, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py b/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py index 08bc7ed6e3..041d68abed 100644 --- a/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py +++ b/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py @@ -40,3 +40,8 @@ def test_ddpm_init(): with pytest.raises(Exception): EditDDPMScheduler(beta_schedule='tem') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py b/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py index c91254b913..a387c62380 100644 --- a/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py +++ b/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py @@ -18,3 +18,8 @@ def test_NormWithEmbedding(): ins = NormWithEmbedding(32, 32) output = ins.forward(input, emb) assert output.shape == (4, 32, 4, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_embeddings.py b/tests/test_models/test_editors/test_ddpm/test_embeddings.py index a0f9822878..71945114a8 100644 --- a/tests/test_models/test_editors/test_ddpm/test_embeddings.py +++ b/tests/test_models/test_editors/test_ddpm/test_embeddings.py @@ -23,3 +23,8 @@ def test_Timesteps(): timesteps = Timesteps(num_channels=9) emb = timesteps.forward(input) assert emb.shape == (1, 9) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_res_blocks.py b/tests/test_models/test_editors/test_ddpm/test_res_blocks.py index db508a57d6..b3ce33c414 100644 --- a/tests/test_models/test_editors/test_ddpm/test_res_blocks.py +++ b/tests/test_models/test_editors/test_ddpm/test_res_blocks.py @@ -32,3 +32,8 @@ def test_Upsample2D(): upsample = Upsample2D(channels=64) output = upsample.forward(input, output_size=(32, 32)) assert output.shape == (1, 64, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py b/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py index 17693e0e44..14927788ec 100644 --- a/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py +++ b/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py @@ -44,3 +44,8 @@ def test_get_down_block(): def get_get_up_block(): with pytest.raises(Exception): get_up_block('tem', 1, 1, 1, 1, 1, True, 'silu', 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py index 63e6fbc840..07fe2ee558 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py @@ -124,3 +124,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss_g_content', 'loss_g_adv', 'loss_g'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py index dcb07e5e70..4668c42cd3 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py @@ -56,3 +56,8 @@ def test_deblurganv2_discriminator(self): assert d.patch_gan assert isinstance(pred, list) assert len(pred) == 2 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py index 5e5250d4c9..1aae9cbc7b 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py @@ -64,3 +64,8 @@ def test_deblurganv2_generator(self): num_filter_fpn=128).cuda() img = g(self.input_tensor) assert img.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py index a3597ddfdd..cadf1f0a38 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py @@ -12,3 +12,8 @@ def test_deepfill_contextual_attention_module(): res, offset = cmodule(x, x, mask) assert res.shape == (2, 128, 64, 64) assert offset.shape == (2, 32, 32, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py index 08dd9a98a5..4e39ec7dff 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py @@ -30,3 +30,8 @@ def test_deepfill_contextual_attention_neck(): assert res.shape == (2, 128, 64, 64) assert offset.shape == (2, 32, 32, 32, 32) assert isinstance(neck.conv1, SimpleGatedConvModule) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py index f03f1f78a5..97777abfc2 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py @@ -40,3 +40,8 @@ def test_deepfill_dec(): assert decoder.dec2.conv.out_channels == 96 * 2 assert not decoder.dec7.with_feat_act assert res.min().item() >= -1. and res.max().item() <= 1 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py index aba79f02d2..5554aa4950 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py @@ -49,3 +49,8 @@ def test_deepfillv1_disc(): global_pred, local_pred = disc((global_x, local_x)) assert global_pred.shape == (2, 1) assert local_pred.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py index 1b7115612f..e2a1510890 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py @@ -81,3 +81,8 @@ def test_deepfill_enc(): assert isinstance(encoder.enc2, SimpleGatedConvModule) assert encoder.enc2.conv.stride == (2, 2) assert encoder.enc2.conv.out_channels == 48 * 2 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py index 4481530027..873138c253 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py @@ -39,3 +39,8 @@ def test_deepfill_refiner(): ContextualAttentionNeck) assert isinstance(refiner.decoder, DeepFillDecoder) assert isinstance(refiner.dilation_neck, GLDilationNeck) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py index 67b4dc031e..4848c4e985 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py @@ -99,3 +99,8 @@ def test_deepfillv1_inpaintor(): assert 'stage2_loss_l1_hole' in log_vars assert 'stage2_loss_l1_valid' in log_vars assert 'stage2_loss_g_fake' in log_vars + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py b/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py index ca8d05cd50..ae4f064c56 100644 --- a/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py +++ b/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py @@ -105,3 +105,8 @@ def test_two_stage_inpaintor(): assert 'stage1_loss_l1_valid' in log_vars assert 'stage2_loss_l1_hole' in log_vars assert 'stage2_loss_l1_valid' in log_vars + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dic/test_dic.py b/tests/test_models/test_editors/test_dic/test_dic.py index dc3f3a8701..1bc34a8675 100644 --- a/tests/test_models/test_editors/test_dic/test_dic.py +++ b/tests/test_models/test_editors/test_dic/test_dic.py @@ -79,3 +79,8 @@ def test_dic(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dic/test_dic_net.py b/tests/test_models/test_editors/test_dic/test_dic_net.py index db14f35036..1813f107e5 100644 --- a/tests/test_models/test_editors/test_dic/test_dic_net.py +++ b/tests/test_models/test_editors/test_dic/test_dic_net.py @@ -124,3 +124,8 @@ def test_dic_net_cuda(): assert len(output) == 4 assert torch.is_tensor(output[-1]) assert output[-1].shape == targets.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py b/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py index d39f8afcbe..27c30327f3 100644 --- a/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py +++ b/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py @@ -65,3 +65,8 @@ def test_reduce_to_five_heatmaps(): with pytest.raises(NotImplementedError): heatmap = torch.rand((2, 12, 64, 64)) reduce_to_five_heatmaps(heatmap, False) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dic/test_light_cnn.py b/tests/test_models/test_editors/test_dic/test_light_cnn.py index dd20dd2b3c..0d82fdddd2 100644 --- a/tests/test_models/test_editors/test_dic/test_light_cnn.py +++ b/tests/test_models/test_editors/test_dic/test_light_cnn.py @@ -51,3 +51,8 @@ def test_light_cnn(): net = net.cuda() output = net(inputs.cuda()) assert output.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dim/test_dim.py b/tests/test_models/test_editors/test_dim/test_dim.py index 5f287ecc7a..f414cbe3b9 100644 --- a/tests/test_models/test_editors/test_dim/test_dim.py +++ b/tests/test_models/test_editors/test_dim/test_dim.py @@ -284,3 +284,8 @@ def test_dim(): test_dim() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py index cd82d9d6cc..172c10dea8 100644 --- a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py +++ b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py @@ -246,3 +246,8 @@ def forward(self, x): num_inference_steps=2, eta=0.8)['samples'] assert image.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py index 289f25e0d2..28708c5d31 100644 --- a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py +++ b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py @@ -115,3 +115,8 @@ def test_embedding_layer_with_fixes(): out_feat = embedding_layer_wrapper(input_ids) assert (out_feat[0, 3:7] == 2.3).all() assert (out_feat[2, 5:9] == 2.3).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py b/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py index de375bd551..9f0d4ec386 100644 --- a/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py +++ b/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py @@ -145,3 +145,8 @@ def forward(self, *args, **kwargs): dreambooth.text_encoder = mock_text_encoder() dreambooth.train_step(data, optim_wrapper) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_duf/test_duf.py b/tests/test_models/test_editors/test_duf/test_duf.py index ffc1755daa..77ef2da7a4 100644 --- a/tests/test_models/test_editors/test_duf/test_duf.py +++ b/tests/test_models/test_editors/test_duf/test_duf.py @@ -33,3 +33,8 @@ def test_dynamic_upsampling_filter(): filters = torch.rand(1, 9, 16, 4, 4).cuda() output = duf(x, filters) assert output.shape == (1, 48, 4, 4) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_edsr/test_edsr_net.py b/tests/test_models/test_editors/test_edsr/test_edsr_net.py index 2741ee363f..90685c1108 100644 --- a/tests/test_models/test_editors/test_edsr/test_edsr_net.py +++ b/tests/test_models/test_editors/test_edsr/test_edsr_net.py @@ -83,3 +83,8 @@ def test_edsr_cuda(): mid_channels=64, num_blocks=16, upscale_factor=5) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_edvr/test_edvr.py b/tests/test_models/test_editors/test_edvr/test_edvr.py index fbdca1592c..7ebb6fbb82 100644 --- a/tests/test_models/test_editors/test_edvr/test_edvr.py +++ b/tests/test_models/test_editors/test_edvr/test_edvr.py @@ -70,3 +70,8 @@ def test_edvr(): type='CharbonnierLoss', loss_weight=1.0, reduction='sum'), train_cfg=dict()) model.train_step(data, optim_wrapper) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_edvr/test_edvr_net.py b/tests/test_models/test_editors/test_edvr/test_edvr_net.py index 584a36f71e..5b8e352dcf 100644 --- a/tests/test_models/test_editors/test_edvr/test_edvr_net.py +++ b/tests/test_models/test_editors/test_edvr/test_edvr_net.py @@ -133,3 +133,8 @@ def test_edvr_net(): # The height and width of inputs should be a multiple of 4 input_tensor = torch.rand(1, 5, 3, 3, 3).cuda() edvrnet(input_tensor) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_camera.py b/tests/test_models/test_editors/test_eg3d/test_camera.py index 5c114db65b..dd4644144b 100644 --- a/tests/test_models/test_editors/test_eg3d/test_camera.py +++ b/tests/test_models/test_editors/test_eg3d/test_camera.py @@ -172,3 +172,8 @@ def test_repr(self): camera = GaussianCamera(**cfg_) repr_string = repr(camera) self.assertIn('GaussianCamera', repr_string) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py b/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py index 07d9c0a728..38c40e782e 100644 --- a/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py +++ b/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py @@ -84,3 +84,8 @@ def test_forward(self): disc = DualDiscriminator(**cfg) out = disc(img, img_raw, None) self.assertEqual(out.shape, (2, 1)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d.py b/tests/test_models/test_editors/test_eg3d/test_eg3d.py index d80012e70f..e2404abdd1 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d.py @@ -168,3 +168,8 @@ def test_interpolation(self): num_images=3, num_batches=2, sample_model='ema') self.assertEqual(len(output_list), 3) self._check_dict_output(output_list, 32, 5, 2) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py index da64b58d1a..daaa896cab 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py @@ -75,3 +75,8 @@ def test_forward(self): _, called_kwargs = render_mock.call_args self.assertIn('render_kwargs', called_kwargs) self.assertDictEqual(called_kwargs['render_kwargs'], render_kwargs) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py index 5325af321a..9859968a17 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py @@ -123,3 +123,8 @@ def test_forward(self): features = torch.randn(2, 8, 3, 3) sr_imgs = sr_model(imgs, features, styles) self.assertEqual(sr_imgs.shape, (2, 3, 8, 8)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py index 201fd99a7f..eb196d9bd6 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py @@ -32,3 +32,8 @@ def test_inverse_transform_sampling(): assert samples_det_1.shape == (10, 5) assert samples_det_2.shape == (10, 5) assert (samples_det_1 == samples_det_2).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py b/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py index 0e38b7958d..ef9daed77a 100644 --- a/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py +++ b/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py @@ -32,3 +32,8 @@ def test_sample_rays(): # check if camera origin in one batch is all same for origin in ray_origins: assert (origin == origin[0]).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_eg3d/test_renderer.py b/tests/test_models/test_editors/test_eg3d/test_renderer.py index 8ddbf7d94f..15fa9eec97 100644 --- a/tests/test_models/test_editors/test_eg3d/test_renderer.py +++ b/tests/test_models/test_editors/test_eg3d/test_renderer.py @@ -108,3 +108,8 @@ def test_forward(self): ray_origins, ray_directions, render_kwargs=render_kwargs) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_esrgan/test_esrgan.py b/tests/test_models/test_editors/test_esrgan/test_esrgan.py index 4a329ad2a9..42c6e2fc85 100644 --- a/tests/test_models/test_editors/test_esrgan/test_esrgan.py +++ b/tests/test_models/test_editors/test_esrgan/test_esrgan.py @@ -79,3 +79,8 @@ def test_esrgan(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py b/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py index d388ef3871..6cd085c669 100644 --- a/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py +++ b/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py @@ -51,3 +51,8 @@ def test_rrdbnet_backbone(): net = net.cuda() output = net(img.cuda()) assert output.shape == (1, 3, 24, 24) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_fba/test_fba_decoder.py b/tests/test_models/test_editors/test_fba/test_fba_decoder.py index c25e306e4d..5c3125f896 100644 --- a/tests/test_models/test_editors/test_fba/test_fba_decoder.py +++ b/tests/test_models/test_editors/test_fba/test_fba_decoder.py @@ -52,3 +52,8 @@ def test_fba_decoder(): assert_tensor_with_shape(alpha, torch.Size([1, 1, 320, 320])) assert_tensor_with_shape(F, torch.Size([1, 3, 320, 320])) assert_tensor_with_shape(B, torch.Size([1, 3, 320, 320])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_fba/test_fba_encoder.py b/tests/test_models/test_editors/test_fba/test_fba_encoder.py index 329bea1fd1..1593731aee 100644 --- a/tests/test_models/test_editors/test_fba/test_fba_encoder.py +++ b/tests/test_models/test_editors/test_fba/test_fba_encoder.py @@ -133,3 +133,8 @@ def test_fba_encoder(): assert isinstance(output['two_channel_trimap'], torch.Tensor) assert_tensor_with_shape(output['two_channel_trimap'], torch.Size([1, 2, 320, 320])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_flavr/test_flavr.py b/tests/test_models/test_editors/test_flavr/test_flavr.py index 5ea3a5af9c..6bc7ffa854 100644 --- a/tests/test_models/test_editors/test_flavr/test_flavr.py +++ b/tests/test_models/test_editors/test_flavr/test_flavr.py @@ -31,3 +31,8 @@ def test_flavr(): result = model.merge_frames(input_tensors, output_tensors) assert len(result) == 15 assert result[0].shape == (16, 16, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_flavr/test_flavr_net.py b/tests/test_models/test_editors/test_flavr/test_flavr_net.py index 9472ea4215..e12d6f482c 100644 --- a/tests/test_models/test_editors/test_flavr/test_flavr_net.py +++ b/tests/test_models/test_editors/test_flavr/test_flavr_net.py @@ -50,3 +50,8 @@ def test_flavr_net(): output = model(inputs) assert torch.is_tensor(output) assert output.shape == target.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_gca/test_gca.py b/tests/test_models/test_editors/test_gca/test_gca.py index 46374693d7..8f23b63eb2 100644 --- a/tests/test_models/test_editors/test_gca/test_gca.py +++ b/tests/test_models/test_editors/test_gca/test_gca.py @@ -179,3 +179,8 @@ def test_gca(): model.cpu().eval() inputs = torch.ones((1, 4, 32, 32)) model.forward(inputs) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_gca/test_gca_module.py b/tests/test_models/test_editors/test_gca/test_gca_module.py index 244b1b7fae..497b027214 100644 --- a/tests/test_models/test_editors/test_gca/test_gca_module.py +++ b/tests/test_models/test_editors/test_gca/test_gca_module.py @@ -131,3 +131,8 @@ def test_gca_module(): gca = GCAModule(128, 128, rate=2) output = gca(img_feat, alpha_feat, unknown) assert output.shape == (1, 128, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_gca/test_resgca_dec.py b/tests/test_models/test_editors/test_gca/test_resgca_dec.py index 1094b67485..08244893ac 100644 --- a/tests/test_models/test_editors/test_gca/test_resgca_dec.py +++ b/tests/test_models/test_editors/test_gca/test_resgca_dec.py @@ -135,3 +135,8 @@ def test_res_gca_decoder(): outputs = encoder(img) prediction = model(outputs) assert_tensor_with_shape(prediction, torch.Size([2, 1, 32, 32])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_gca/test_resgca_enc.py b/tests/test_models/test_editors/test_gca/test_resgca_enc.py index 94c0f3892b..64c4a52407 100644 --- a/tests/test_models/test_editors/test_gca/test_resgca_enc.py +++ b/tests/test_models/test_editors/test_gca/test_resgca_enc.py @@ -176,3 +176,8 @@ def test_res_shortcut_encoder(): assert_tensor_with_shape(outputs['feat3'], target_late_ds_shape[2]) assert_tensor_with_shape(outputs['feat4'], target_late_ds_shape[3]) assert_tensor_with_shape(outputs['feat5'], target_late_ds_shape[4]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ggan/test_ggan.py b/tests/test_models/test_editors/test_ggan/test_ggan.py index 40c98cb8a9..89abd12d86 100644 --- a/tests/test_models/test_editors/test_ggan/test_ggan.py +++ b/tests/test_models/test_editors/test_ggan/test_ggan.py @@ -95,3 +95,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py b/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py index 09d3980006..a89aa8b653 100644 --- a/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py +++ b/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py @@ -82,3 +82,8 @@ def test_glean(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_glide/test_glide.py b/tests/test_models/test_editors/test_glide/test_glide.py index fd561a7e01..c193a9b084 100644 --- a/tests/test_models/test_editors/test_glide/test_glide.py +++ b/tests/test_models/test_editors/test_glide/test_glide.py @@ -105,3 +105,8 @@ def test_infer(self): prompt=text_prompts, show_progress=True, num_inference_steps=2)['samples'] assert image.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_decoder.py b/tests/test_models/test_editors/test_global_local/test_gl_decoder.py index a48ea8c4b3..099105fc3a 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_decoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_decoder.py @@ -33,3 +33,8 @@ def test_gl_decoder(): gl_decoder = gl_decoder.cuda() output = gl_decoder(input_x.cuda()) assert output.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_dilation.py b/tests/test_models/test_editors/test_global_local/test_gl_dilation.py index cabfd74876..11fde4e9ff 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_dilation.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_dilation.py @@ -27,3 +27,8 @@ def test_gl_dilation_neck(): res = neck(x) assert isinstance(neck.dilation_convs[0], SimpleGatedConvModule) assert res.shape == (2, 8, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_disc.py b/tests/test_models/test_editors/test_global_local/test_gl_disc.py index d44ce7434c..9e55ab050d 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_disc.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_disc.py @@ -41,3 +41,8 @@ def test_gl_discs(): input_l = torch.randn(1, 3, 128, 128).cuda() output = gl_discs((input_g, input_l)) assert output.shape == (1, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_encoder.py b/tests/test_models/test_editors/test_global_local/test_gl_encoder.py index 95691e7539..c9db271551 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_encoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_encoder.py @@ -19,3 +19,8 @@ def test_gl_encoder(): gl_encoder = gl_encoder.cuda() output = gl_encoder(input_x.cuda()) assert output.shape == (1, 256, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py b/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py index 98c0f2eb88..a481b8c234 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py @@ -36,3 +36,8 @@ def test_gl_encdec(): gl_encdec = gl_encdec.cuda() output = gl_encdec(input_x.cuda()) assert output.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py b/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py index b0fadfc30f..8ccab3ff48 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py @@ -69,3 +69,8 @@ def test_gl_inpaintor(): res, loss = gl_dirty.generator_loss(gt_img, gt_img, gt_img, gt_img, mask, masked_img) assert len(loss) == 0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_guided_diffusion/test_adm.py b/tests/test_models/test_editors/test_guided_diffusion/test_adm.py index b670ff0c23..58e131169c 100644 --- a/tests/test_models/test_editors/test_guided_diffusion/test_adm.py +++ b/tests/test_models/test_editors/test_guided_diffusion/test_adm.py @@ -87,3 +87,8 @@ def test_infer(self): classifier_scale=1.0, show_progress=False)['samples'] assert samples.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py b/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py index ea87881836..c40405be4b 100644 --- a/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py +++ b/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py @@ -80,3 +80,8 @@ def test_iconvsr(): padding=2, spynet_pretrained=None, edvr_pretrained=123).cuda() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet.py b/tests/test_models/test_editors/test_indexnet/test_indexnet.py index e20fb4856c..3c7df55de8 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet.py @@ -209,3 +209,8 @@ def test_indexed_upsample(): shortcut = torch.rand(2, 6, 64, 64) output = indexed_upsample(x, shortcut, dec_idx_feat) assert_tensor_with_shape(output, (2, 12, 64, 64)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py b/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py index d6195db926..e0fb0c273d 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py @@ -33,3 +33,8 @@ def test_indexnet_decoder(): indexnet_decoder.init_weights() out = indexnet_decoder(outputs_enc) assert out.shape == (2, 1, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py b/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py index 87787682ec..330ede1e46 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py @@ -139,3 +139,8 @@ def test_index_blocks(): enc_idx_feat, dec_idx_feat = block(x) assert enc_idx_feat.shape == (2, 128, 8, 8) assert dec_idx_feat.shape == (2, 128, 8, 8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py b/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py index b24141e46c..401dd87f97 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py @@ -151,3 +151,8 @@ def test_encode_ab_ind(self): assert data_q.shape == (1, 1, 8, 8) assert data_q.equal(data_ab_rs[:, [0], :, :] * A + data_ab_rs[:, [1], :, :]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py b/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py index e9da280267..e213cb76b2 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py @@ -40,3 +40,8 @@ def test_colorization_net(): assert isinstance(feature_map, dict) for item in feature_map.keys(): assert torch.is_tensor(feature_map[item]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py b/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py index e46e99a01f..92906a1384 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py @@ -79,3 +79,8 @@ def test_fusion_net(): output = model(input_A, input_B, mask_B, instance_feature, box_info_box) assert torch.is_tensor(output) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py b/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py index 56b67e7d25..6ac917779d 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py @@ -121,3 +121,8 @@ def test_inst_colorization(self): assert torch.is_tensor(res) assert res.shape == target_shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py b/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py index 69d7600785..a3c4b50e61 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py @@ -28,3 +28,8 @@ def test_weight_layer(): conv1_2 = weight_layer(instance_feature_conv1_2, conv1_2, box_info) assert conv1_2.shape == instance_feature_conv1_2.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_liif/test_liif.py b/tests/test_models/test_editors/test_liif/test_liif.py index a8e3b88cb6..357d3f95ad 100644 --- a/tests/test_models/test_editors/test_liif/test_liif.py +++ b/tests/test_models/test_editors/test_liif/test_liif.py @@ -71,3 +71,8 @@ def test_liif(): output = model( torch.rand(1, 3, 8, 8), DataSample.stack([data_sample]), mode='tensor') assert output.shape == (1, 256, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_liif/test_liif_net.py b/tests/test_models/test_editors/test_liif/test_liif_net.py index 6c7d649a05..d93a221af4 100644 --- a/tests/test_models/test_editors/test_liif/test_liif_net.py +++ b/tests/test_models/test_editors/test_liif/test_liif_net.py @@ -113,3 +113,8 @@ def test_liif_rdn_net(): output = model(inputs, coord, cell, True) assert torch.is_tensor(output) assert output.shape == targets.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_liif/test_mlp_refiner.py b/tests/test_models/test_editors/test_liif/test_mlp_refiner.py index a13e743a8d..abc7fe0153 100644 --- a/tests/test_models/test_editors/test_liif/test_mlp_refiner.py +++ b/tests/test_models/test_editors/test_liif/test_mlp_refiner.py @@ -9,3 +9,8 @@ def test_MLPRefiner(): inputs = torch.randn(1, 8) outputs = model(inputs) assert outputs.shape == (1, 2) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan.py b/tests/test_models/test_editors/test_lsgan/test_lsgan.py index 32b32fa876..152737b892 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan.py @@ -95,3 +95,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py b/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py index 6481ec48ea..15bb627845 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py @@ -70,3 +70,8 @@ def test_lsgan_discriminator_cuda(self): x = torch.randn((2, 3, 64, 64)) score = d(x.cuda()) assert score.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py b/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py index 4843a6f074..1e332864fa 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py @@ -56,3 +56,8 @@ def test_lsgan_generator_cuda(self): assert isinstance(g, LSGANGenerator) x = g(None, num_batches=3) assert x.shape == (3, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py index 01758bad14..7abcdd09e0 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py @@ -70,3 +70,8 @@ def test_stylegan2_cpu(self): # simulate train_loop here message_hub.update_info('iter', 0) _ = gan.train_step(data, optim_wrapper_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py index 5290d8ee10..144c0115d4 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py @@ -35,3 +35,8 @@ def test_msstylegan2_disc_cuda(self): img = torch.randn((2, 3, 64, 64)).cuda() score = d(img) assert score.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py index 1d8ff866a1..5ccad9ed90 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py @@ -133,3 +133,8 @@ def test_head_pos_encoding(self): g = MSStyleGANv2Generator( **cfg, head_pos_encoding=dict(type='MockHeadPosEncoding')) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py index 03d61773eb..d8d8dbca0c 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py @@ -108,3 +108,8 @@ def test_up_after_conv(self): **cfg, upsample=True, deconv2conv=True, interp_pad=3) out = conv(x, style) self.assertEqual(out.shape, (1, 8, 67, 67)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_pe_singan.py b/tests/test_models/test_editors/test_mspie/test_pe_singan.py index cd689b3327..f7c2726c1c 100644 --- a/tests/test_models/test_editors/test_mspie/test_pe_singan.py +++ b/tests/test_models/test_editors/test_mspie/test_pe_singan.py @@ -118,3 +118,8 @@ def test_pesingan_cpu(self): elif i in [4, 5]: assert singan.curr_stage == 2 assert img.shape[-2:] == (32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py b/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py index fe479b9580..6ef6df28d3 100644 --- a/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py +++ b/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py @@ -93,3 +93,8 @@ def test_singan_gen_pe(self): interp_pad=True, noise_with_pad=False, **self.default_args) res = gen(None, self.fixed_noises, self.noise_weights, 'rand', 2) assert res.shape == (1, 3, 12, 12) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_mspie/test_positional_encoding.py b/tests/test_models/test_editors/test_mspie/test_positional_encoding.py index b069a2a1ea..08d9afa4b3 100644 --- a/tests/test_models/test_editors/test_mspie/test_positional_encoding.py +++ b/tests/test_models/test_editors/test_mspie/test_positional_encoding.py @@ -57,3 +57,8 @@ def test_csg_cpu(self): def test_csg_cuda(self): embed = self.csg(torch.randn((2, 4, 5, 5)).cuda()) assert embed.shape == (2, 2, 5, 5) and embed.is_cuda + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py b/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py index b2a9d40ca6..d06de750a7 100644 --- a/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py +++ b/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py @@ -51,3 +51,8 @@ def test_avgpool2d(): print(outputs) assert info == tar_info assert torch.all(torch.eq(targets, outputs)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py b/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py index eefd626115..9641c975e1 100644 --- a/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py +++ b/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py @@ -12,3 +12,8 @@ def test_layer_norm(): outputs = layer_norm_2d(inputs) assert outputs.shape == targets.shape assert torch.all(torch.eq(outputs, targets)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py b/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py index 7bdb6fcf5e..7c06f26df4 100644 --- a/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py +++ b/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py @@ -66,3 +66,8 @@ def test_baseline_local(): output = model(inputs) assert torch.is_tensor(output) assert output.shape == targets.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_nafnet/test_nafnet.py b/tests/test_models/test_editors/test_nafnet/test_nafnet.py index 56ed5bbf7a..a8a05b49c8 100644 --- a/tests/test_models/test_editors/test_nafnet/test_nafnet.py +++ b/tests/test_models/test_editors/test_nafnet/test_nafnet.py @@ -66,3 +66,8 @@ def test_nafnet_local(): output = model(inputs) assert torch.is_tensor(output) assert output.shape == targets.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py b/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py index 4de08490d5..95c741e3af 100644 --- a/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py +++ b/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py @@ -76,3 +76,8 @@ def test_mask_conv_module(): with pytest.raises(KeyError): conv = MaskConvModule(3, 8, 3, padding=1, padding_mode='igccc') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_partial_conv.py b/tests/test_models/test_editors/test_pconv/test_partial_conv.py index 0b20395190..347bb2f0aa 100644 --- a/tests/test_models/test_editors/test_pconv/test_partial_conv.py +++ b/tests/test_models/test_editors/test_pconv/test_partial_conv.py @@ -71,3 +71,8 @@ def test_pconv2d(): eps=1e-8).cuda().half() output = pconv2d(x.cuda().half(), mask=None) assert output.shape == (1, 2, 6, 6) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py index 5f78de358e..b228e444b4 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py @@ -21,3 +21,8 @@ def test_pconv_dec(): h, h_mask = pconv_dec(input) assert h.detach().numpy().shape == (2, 3, 128, 128) assert h_mask.detach().numpy().shape == (2, 3, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py index 90201220f1..bd2bb4575e 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py @@ -25,3 +25,8 @@ def test_pconv_enc(): assert isinstance(output['hidden_feats'], dict) assert isinstance(output['hidden_masks'], dict) assert output['out'].detach().numpy().shape == (2, 512, 1, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py index 305c936130..14586d6efc 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py @@ -22,3 +22,8 @@ def test_pconv_encdec(): with pytest.raises(TypeError): pconv_encdec.init_weights(pretrained=dict(igccc=8989)) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py b/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py index ad835d2bd2..981430a217 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py @@ -62,3 +62,8 @@ def test_pconv_inpaintor(): assert 'fake_img' in prediction assert 'pred_img' in prediction assert prediction.pred_img.shape == (3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan.py b/tests/test_models/test_editors/test_pggan/test_pggan.py index 8e1a56407d..49a7f24bbc 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan.py @@ -184,3 +184,8 @@ def test_pggan_cuda(self): assert np.isclose(pggan._actual_nkimgs[0], 0.006, atol=1e-8) elif iter_num == 5: assert np.isclose(pggan._actual_nkimgs[-1], 0.012, atol=1e-8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py b/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py index dddb7119cf..d2b9451c41 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py @@ -72,3 +72,8 @@ def test_pggan_discriminator_cuda(self): self.default_inputx4.cuda(), transition_weight=0.1, curr_scale=4) assert score.shape == (2, 1) assert label.shape == (2, 2) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_generator.py b/tests/test_models/test_editors/test_pggan/test_pggan_generator.py index 33fec9f094..2350811aae 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_generator.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_generator.py @@ -70,3 +70,8 @@ def test_pggan_generator_cuda(self): gen = PGGANGenerator(**cfg).cuda() res = gen(None, num_batches=2, transition_weight=0.1) assert res.shape == (2, 3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_modules.py b/tests/test_models/test_editors/test_pggan/test_pggan_modules.py index e8fcc563f6..a8190b4706 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_modules.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_modules.py @@ -333,3 +333,8 @@ def test_pggan_noise2feat_cuda(self): assert not module.linear.bias assert module.with_norm assert isinstance(module.activation, nn.LeakyReLU) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py index f95f28ab99..441f11102e 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py @@ -250,3 +250,8 @@ def test_pix2pix_val_step(): # assert 'gt_photo' in out[0] # assert 'gt_mask' in out[0] assert 'fake_photo' in out[0] + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py index d7a182d7f1..f671be26b6 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py @@ -60,3 +60,8 @@ def test_pix2pix_generator_cuda(self): with pytest.raises(TypeError): gen = UnetGenerator(**self.default_cfg) gen.init_weights(pretrained=10) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py index 506731d384..125b56d9c2 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py @@ -10,3 +10,8 @@ def test_unet_skip_connection_block(): input = torch.rand((2, 16, 128, 128)) output = block(input) assert output.detach().numpy().shape == (2, 32, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_plain/test_plain_decoder.py b/tests/test_models/test_editors/test_plain/test_plain_decoder.py index 528c0661e3..de55391078 100644 --- a/tests/test_models/test_editors/test_plain/test_plain_decoder.py +++ b/tests/test_models/test_editors/test_plain/test_plain_decoder.py @@ -57,3 +57,8 @@ def test_plain_decoder(): outputs = encoder(img) prediction = model(outputs) assert_tensor_with_shape(prediction, torch.Size([1, 1, 64, 64])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_plain/test_plain_refiner.py b/tests/test_models/test_editors/test_plain/test_plain_refiner.py index 8d7e68aa47..467350d20a 100644 --- a/tests/test_models/test_editors/test_plain/test_plain_refiner.py +++ b/tests/test_models/test_editors/test_plain/test_plain_refiner.py @@ -18,3 +18,8 @@ def test_plain_refiner(): raw_alpha = torch.rand((2, 1, 128, 128)) output = plain_refiner(input, raw_alpha) assert output.detach().numpy().shape == (2, 1, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_rdn/test_rdn_net.py b/tests/test_models/test_editors/test_rdn/test_rdn_net.py index c6ea290976..f76819f8fb 100644 --- a/tests/test_models/test_editors/test_rdn/test_rdn_net.py +++ b/tests/test_models/test_editors/test_rdn/test_rdn_net.py @@ -58,3 +58,8 @@ def test_rdn(): optimizer.step() assert torch.is_tensor(output) assert output.shape == targets.shape + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py index dd54f79213..f0e72b60c0 100644 --- a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py +++ b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py @@ -112,3 +112,8 @@ def test_real_basicvsr(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py index ae261a705d..83e9c2bbde 100644 --- a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py +++ b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py @@ -49,3 +49,8 @@ def test_real_basicvsr_net(): output, lq = real_basicvsr(input_tensor, return_lqs=True) assert output.shape == (1, 5, 3, 256, 256) assert lq.shape == (1, 5, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py b/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py index 0727ff9d68..37d548589c 100644 --- a/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py +++ b/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py @@ -110,3 +110,8 @@ def test_real_esrgan(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py b/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py index e268136e47..bc76ee2d64 100644 --- a/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py +++ b/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py @@ -23,3 +23,8 @@ def test_unet_disc_with_spectral_norm(): img = img.cuda() output = disc(img) assert output.detach().cpu().numpy().shape == (1, 1, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_restormer/test_restormer_net.py b/tests/test_models/test_editors/test_restormer/test_restormer_net.py index d48969f899..98633e008a 100644 --- a/tests/test_models/test_editors/test_restormer/test_restormer_net.py +++ b/tests/test_models/test_editors/test_restormer/test_restormer_net.py @@ -106,3 +106,8 @@ def test_restormer_cuda(): output = net(img.cuda()) assert isinstance(output, torch.Tensor) assert output.shape == (1, 3, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan.py b/tests/test_models/test_editors/test_sagan/test_sagan.py index 1feb3d9878..36864bba56 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan.py @@ -128,3 +128,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py b/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py index 80969ece02..b6925bdfa8 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py @@ -275,3 +275,8 @@ def test_sngan_proj_discriminator_cuda(self): assert isinstance(d, ProjDiscriminator) score = d(self.x.cuda(), self.label.cuda()) assert score.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_generator.py b/tests/test_models/test_editors/test_sagan/test_sagan_generator.py index 58d4ea018a..d12b5c0556 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_generator.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_generator.py @@ -300,3 +300,8 @@ def test_sngan_proj_generator_cuda(self): assert isinstance(g, SNGANGenerator) x = g(None, num_batches=2) assert x.shape == (2, 3, 32, 32) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_modules.py b/tests/test_models/test_editors/test_sagan/test_sagan_modules.py index 5746b267ff..37ce9d21ed 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_modules.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_modules.py @@ -504,3 +504,8 @@ def test_conditionalNorm_cuda(self): norm = MODELS.build(config).cuda() out = norm(self.input.cuda(), self.label.cuda()) assert out.shape == (2, 4, 4, 4) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_singan/test_singan.py b/tests/test_models/test_editors/test_singan/test_singan.py index 716dddcf02..2a6ff52ea9 100644 --- a/tests/test_models/test_editors/test_singan/test_singan.py +++ b/tests/test_models/test_editors/test_singan/test_singan.py @@ -125,3 +125,8 @@ def test_singan_cpu(self): assert all([hasattr(out.orig, 'prev_res_list') for out in outputs]) assert all([hasattr(out.ema, 'prev_res_list') for out in outputs]) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_singan/test_singan_discriminator.py b/tests/test_models/test_editors/test_singan/test_singan_discriminator.py index 1c4d952dc5..24a207c509 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_discriminator.py +++ b/tests/test_models/test_editors/test_singan/test_singan_discriminator.py @@ -22,3 +22,8 @@ def test_singan_disc(self): img = torch.randn(1, 3, 24, 24) res = disc(img, 2) assert res.shape[0] == 1 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_singan/test_singan_generator.py b/tests/test_models/test_editors/test_singan/test_singan_generator.py index 8b3b73d129..cd6e7ca069 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_generator.py +++ b/tests/test_models/test_editors/test_singan/test_singan_generator.py @@ -42,3 +42,8 @@ def test_singan_gen(self): get_prev_res=True) assert output['prev_res_list'][0].shape == (1, 3, 8, 8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_singan/test_singan_modules.py b/tests/test_models/test_editors/test_singan/test_singan_modules.py index 503d551e5c..a5d11c9163 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_modules.py +++ b/tests/test_models/test_editors/test_singan/test_singan_modules.py @@ -24,3 +24,8 @@ def test_DiscriminatorBlock(): x = torch.randn(1, 3, 6, 6) out = disc_block(x) assert out.shape == (1, 1, 6, 6) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py b/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py index 385d58375e..d7fb548a07 100644 --- a/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py +++ b/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py @@ -36,3 +36,8 @@ def test_srcnn(): # The length of kernel tuple should be 3 net = SRCNNNet( channels=(3, 4, 4, 3), kernel_sizes=(9, 1, 1, 5), upscale_factor=4) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_srgan/test_modified_vgg.py b/tests/test_models/test_editors/test_srgan/test_modified_vgg.py index 6eae214149..be8020b521 100644 --- a/tests/test_models/test_editors/test_srgan/test_modified_vgg.py +++ b/tests/test_models/test_editors/test_srgan/test_modified_vgg.py @@ -9,3 +9,8 @@ def test_modifiedVGG(): inputs = torch.randn(1, 3, 128, 128) outputs = model(inputs) assert outputs.shape == (1, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_srgan/test_sr_resnet.py b/tests/test_models/test_editors/test_srgan/test_sr_resnet.py index 2ec837ae03..5117d691a8 100644 --- a/tests/test_models/test_editors/test_srgan/test_sr_resnet.py +++ b/tests/test_models/test_editors/test_srgan/test_sr_resnet.py @@ -73,3 +73,8 @@ def test_discriminator(): input_shape = (1, 3, 64, 64) img = torch.rand(input_shape) output = net(img) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_srgan/test_srgan.py b/tests/test_models/test_editors/test_srgan/test_srgan.py index f531002659..2437db233a 100644 --- a/tests/test_models/test_editors/test_srgan/test_srgan.py +++ b/tests/test_models/test_editors/test_srgan/test_srgan.py @@ -78,3 +78,8 @@ def test_srgan_resnet(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py b/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py index c41326f9d4..12680a326e 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py @@ -51,3 +51,8 @@ def test_load_clip_submodels_transformers_none(): load_clip_submodels(init_cfg, submodels, True) sys.modules['transformers'] = transformer_location + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py index 4838a9c9f8..79010d7131 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py @@ -121,3 +121,8 @@ def test_stable_diffusion(): width=64, num_inference_steps=1, return_type='image') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py index 9ed1cf30bb..42adb5b10b 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py @@ -135,3 +135,8 @@ class DummyConfig: width=64, num_inference_steps=1, return_type='image') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py index a5b0e5b5e3..0b94f04c30 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py @@ -126,3 +126,8 @@ def test_stable_diffusion(): width=64, num_inference_steps=1, return_type='image') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_vae.py b/tests/test_models/test_editors/test_stable_diffusion/test_vae.py index 54d169b125..fb3cff952f 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_vae.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_vae.py @@ -64,3 +64,8 @@ def test_Upsample2D(): upsample = Upsample2D(channels=64) output = upsample.forward(input, output_size=(32, 32)) assert output.shape == (1, 64, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py index 9e3e1b2ce6..00dbe563e0 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py @@ -194,3 +194,8 @@ def test_stylegan_cuda(self): elif iter_num == 5: assert np.isclose( stylegan._actual_nkimgs[-1], 0.012, atol=1e-8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py index d119dd1ac9..b9de1f1650 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py @@ -31,3 +31,8 @@ def test_stylegan1_disc_cpu(self): img = torch.randn((2, 3, 64, 64)) score = d(img) assert score.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py index 78033c3d01..4b899bbb3c 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py @@ -165,3 +165,8 @@ def test_g_cpu(self): g = StyleGAN1Generator(**cfg_) res = g(None, num_batches=2) assert res.shape == (2, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py index 70dd5a2e26..45ba9281d5 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py @@ -47,3 +47,8 @@ def test_styleconv_cuda(self): res = conv(input_x, input_style1, input_style2) assert res.shape == (2, 256, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py index be22e6c455..0812d869b7 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py @@ -30,3 +30,8 @@ def mock_generator(code, *args, **kwargs): def test_style_mixing(): out = style_mixing(mock_generator, n_source=10, n_target=11) assert out.shape == ((1 + 10 + (1 + 10) * 11), 3, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py b/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py index 273a219f88..51464ee316 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py +++ b/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py @@ -69,3 +69,8 @@ def test_forward(self): inp = torch.rand(2, 3, 64, 64) out = augment_pipeline(inp) assert out.shape == (2, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py index 450e8b8591..13d15a6236 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py @@ -67,3 +67,8 @@ def test_stylegan2_cpu(self): # simulate train_loop here message_hub.update_info('iter', 0) _ = stylegan2.train_step(data, optim_wrapper_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py index f81380c597..2289d600c3 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py @@ -111,3 +111,8 @@ def test_ada_pipeline(): ada.update(1, 2) ada.update(2, 2) assert (ada.log_buffer == 0).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py index 89b16c41b7..a4a14b1854 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py @@ -245,3 +245,8 @@ def test_g_cuda(self): g(None, num_batches=2) res = g(None, num_batches=2, label=torch.randn(2, 10)) assert res.shape == (2, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py index 23326eb78a..30eda8286a 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py @@ -258,3 +258,8 @@ def test_torgb_cuda(self): skip = torch.randn(2, 3, 4, 4).cuda() res = model(input_x, style, skip) assert res.shape == (2, 3, 8, 8) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py index a8c828e40a..d7436aa27c 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py @@ -93,3 +93,8 @@ def test_train_step(self): data = dict(inputs=dict(), data_samples=[DataSample(gt_img=img)]) message_hub.update_info('iter', 0) _ = stylegan.train_step(data, optim_wrapper_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py index df55822863..b68ad7cc0e 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py @@ -114,3 +114,8 @@ def test_cuda(self): res = generator(torch.randn, num_batches=1) assert res.shape == (1, 3, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py index 794f96295f..41df3676c3 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py @@ -48,3 +48,8 @@ def test_MappingNetwork(): # test z is None + noise_size > 0 with pytest.raises(AssertionError): mapping_network(None) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py index bbffe81c91..9d626f98f5 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py @@ -71,3 +71,8 @@ def test_fractional_pseduo_rotation(): ref, ref_mask = apply_fractional_pseudo_rotation(x, angle) print(ref.shape) print(ref_mask.shape) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_modules.py b/tests/test_models/test_editors/test_swinir/test_swinir_modules.py index 7af6525863..24e9e6accb 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_modules.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_modules.py @@ -82,3 +82,8 @@ def test_upsampleOneStep(): net = net.cuda() output = net(img.cuda()) assert output.shape == (1, 4, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_net.py b/tests/test_models/test_editors/test_swinir/test_swinir_net.py index 9f82495322..ac18e0d9ad 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_net.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_net.py @@ -106,3 +106,8 @@ def test_swinir_cuda(): output = net(img.cuda()) assert isinstance(output, torch.Tensor) assert output.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py b/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py index 7723bd720d..8ee91e1b9a 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py @@ -23,3 +23,8 @@ def test_rstb(): net = net.cuda() output = net(img.cuda(), (8, 8)) assert output.shape == (1, 64, 6) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_utils.py b/tests/test_models/test_editors/test_swinir/test_swinir_utils.py index 2e489caf61..0238c5912b 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_utils.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_utils.py @@ -24,3 +24,8 @@ def test_window(): assert x.shape == (4, 4, 4, 3) x = window_reverse(x, 4, 8, 8) assert x.shape == (1, 8, 8, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_tdan/test_tdan.py b/tests/test_models/test_editors/test_tdan/test_tdan.py index 98a36a76d3..1a7848a89c 100644 --- a/tests/test_models/test_editors/test_tdan/test_tdan.py +++ b/tests/test_models/test_editors/test_tdan/test_tdan.py @@ -42,3 +42,8 @@ def test_tdan(): # feat output = model(torch.rand(1, 5, 3, 16, 16), mode='tensor') assert output.shape == (1, 3, 64, 64) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_tdan/test_tdan_net.py b/tests/test_models/test_editors/test_tdan/test_tdan_net.py index 397377644f..eca59b6a80 100644 --- a/tests/test_models/test_editors/test_tdan/test_tdan_net.py +++ b/tests/test_models/test_editors/test_tdan/test_tdan_net.py @@ -16,3 +16,8 @@ def test_tdan_net(): assert len(output) == 2 # (1) HR center + (2) aligned LRs assert output[0].shape == (1, 3, 256, 256) # HR center frame assert output[1].shape == (1, 5, 3, 64, 64) # aligned LRs + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py b/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py index 5af54e7e1f..1d67f491ec 100644 --- a/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py +++ b/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py @@ -26,3 +26,8 @@ def test_tof_vfi_net(): output = model(inputs) assert torch.is_tensor(output) assert output.shape == (1, 3, 256, 256) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py b/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py index 6fc30bc9c4..2f59220a08 100644 --- a/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py +++ b/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py @@ -17,3 +17,8 @@ def test_toflow_vsr_net(): out = model(imgs) assert isinstance(out, torch.Tensor) assert out.shape == (2, 3, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ttsr/test_lte.py b/tests/test_models/test_editors/test_ttsr/test_lte.py index 10a5878c89..c620936f66 100644 --- a/tests/test_models/test_editors/test_ttsr/test_lte.py +++ b/tests/test_models/test_editors/test_ttsr/test_lte.py @@ -20,3 +20,8 @@ def test_lte(): assert x_level1.shape == (2, 64, 64, 64) assert x_level2.shape == (2, 128, 32, 32) assert x_level3.shape == (2, 256, 16, 16) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ttsr/test_search_transformer.py b/tests/test_models/test_editors/test_ttsr/test_search_transformer.py index 5d8cab36ff..6531fdcee9 100644 --- a/tests/test_models/test_editors/test_ttsr/test_search_transformer.py +++ b/tests/test_models/test_editors/test_ttsr/test_search_transformer.py @@ -22,3 +22,8 @@ def test_search_transformer(): assert t_level3.shape == (2, 32, 32, 32) assert t_level2.shape == (2, 16, 64, 64) assert t_level1.shape == (2, 8, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr.py b/tests/test_models/test_editors/test_ttsr/test_ttsr.py index 6a7b0dbde2..d909d5ac53 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr.py @@ -108,3 +108,8 @@ def test_ttsr(init_weights): # reset mock to clear some memory usage init_weights.reset_mock() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py b/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py index 9e8321754a..53f682e476 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py @@ -22,3 +22,8 @@ def test_ttsr_dict(): net = net.cuda() output = net(inputs.cuda()) assert output.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py b/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py index b2fb267046..58eef6201f 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py @@ -72,3 +72,8 @@ def test_ttsr_net(): outputs = ttsr(inputs, soft_attention, (t_level3, t_level2, t_level1)) assert outputs.shape == (2, 3, 96, 96) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py index 44b283caa8..3f4514f449 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py @@ -106,3 +106,8 @@ def test_wgangp_discriminator_cuda(self): assert isinstance(d, WGANGPDiscriminator) score = d(self.x.cuda()) assert score.shape == (2, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py index 84b93cb390..ff45c12eab 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py @@ -82,3 +82,8 @@ def test_wgangp_generator_cuda(self): assert isinstance(g, WGANGPGenerator) x = g(None, num_batches=3) assert x.shape == (3, 3, 128, 128) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py index 73bdc29075..69e32317e0 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py @@ -101,3 +101,8 @@ def test_train_step(self): self.assertEqual( log.keys(), set(['loss', 'loss', 'loss_disc_fake', 'loss_disc_real'])) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py index db28fc0de7..6098561b2f 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py @@ -24,3 +24,8 @@ def test_WGANNoiseTo2DFeat(): noise = torch.randn(1, 16) feat = noise2feat(noise) assert feat.shape == (1, 32, 4, 4) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_clip_loss.py b/tests/test_models/test_losses/test_clip_loss.py index e93683e960..47c7394b6b 100644 --- a/tests/test_models/test_losses/test_clip_loss.py +++ b/tests/test_models/test_losses/test_clip_loss.py @@ -24,3 +24,8 @@ def test_clip_loss(): text_inputs = torch.cat([clip.tokenize(text)]) loss = clip_loss(image, text_inputs) print(loss) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_composition_loss.py b/tests/test_models/test_losses/test_composition_loss.py index acbe098f69..a9e2199909 100644 --- a/tests/test_models/test_losses/test_composition_loss.py +++ b/tests/test_models/test_losses/test_composition_loss.py @@ -78,3 +78,8 @@ def test_composition_losses(): loss = cb_comp_loss(pred_alpha, fg, bg, ori_merged, weight) assert loss.shape == () assert math.isclose(loss.item(), 1536, rel_tol=1e-6) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_face_id_loss.py b/tests/test_models/test_losses/test_face_id_loss.py index d3a0c68d04..8263a5eade 100644 --- a/tests/test_models/test_losses/test_face_id_loss.py +++ b/tests/test_models/test_losses/test_face_id_loss.py @@ -16,3 +16,8 @@ def test_face_id_loss(): gt, pred = torch.randn(1, 3, 224, 224), torch.randn(1, 3, 224, 224) loss = face_id_loss(pred, gt) assert loss.shape == () + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_feature_loss.py b/tests/test_models/test_losses/test_feature_loss.py index c80236a27d..82dd060f83 100644 --- a/tests/test_models/test_losses/test_feature_loss.py +++ b/tests/test_models/test_losses/test_feature_loss.py @@ -50,3 +50,8 @@ def test_light_cnn_feature_loss(): # test criterion value error with pytest.raises(ValueError): LightCNNFeatureLoss(pretrained=pretrained, criterion='l2') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_gan_loss.py b/tests/test_models/test_losses/test_gan_loss.py index c053fc908a..affb688e40 100644 --- a/tests/test_models/test_losses/test_gan_loss.py +++ b/tests/test_models/test_losses/test_gan_loss.py @@ -115,3 +115,8 @@ def test_gan_losses(): mask = torch.ones(1, 3) gausian_blur = GaussianBlur() gausian_blur(mask).detach().cpu() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_gradient_loss.py b/tests/test_models/test_losses/test_gradient_loss.py index b5c431c784..31b7eb4a48 100644 --- a/tests/test_models/test_losses/test_gradient_loss.py +++ b/tests/test_models/test_losses/test_gradient_loss.py @@ -52,3 +52,8 @@ def test_disc_shift_loss(): loss = loss_disc_shift(x) npt.assert_almost_equal(loss.item(), 0.001) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py index d1bedd5495..bd63933a0b 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py @@ -27,3 +27,8 @@ def test_clip_loss(): data_dict = dict(fake_imgs=image, descriptions=text_inputs) loss = clip_loss_comps(outputs_dict=data_dict) print(loss) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py index d25a57d0f6..cc8cb642ad 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py @@ -154,3 +154,8 @@ def test_r1_regularizer(self): with pytest.raises(AssertionError): _ = gp_loss(1., 2, outputs_dict=data_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py index c734f0bbfd..0cef397fce 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py @@ -21,3 +21,8 @@ def test_face_id_loss_comps(): fake_imgs=torch.randn(1, 3, 224, 224)) loss = face_id_loss_comps(outputs_dict=data_dict) assert loss.shape == () + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py index dbd59b3652..d5b56379f6 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py @@ -76,3 +76,8 @@ def test_gan_losses(): npt.assert_almost_equal(loss.item(), 0.0) loss = gan_loss(input_2, False, is_disc=True) npt.assert_almost_equal(loss.item(), 3.0) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py index 09b6fca615..35a2c48bd9 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py @@ -69,3 +69,8 @@ def test_path_regularizer_cuda(self): with pytest.raises(AssertionError): _ = pl(1., 2, outputs_dict=output_dict) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_loss_wrapper.py b/tests/test_models/test_losses/test_loss_wrapper.py index 02550579c5..bd2259c61c 100644 --- a/tests/test_models/test_losses/test_loss_wrapper.py +++ b/tests/test_models/test_losses/test_loss_wrapper.py @@ -55,3 +55,8 @@ def test_utils(): with pytest.raises(AssertionError): weight_wrong = weight[:, 0:2, ...] reduced = mask_reduce_loss(loss, weight=weight_wrong, reduction='mean') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_perceptual_loss.py b/tests/test_models/test_losses/test_perceptual_loss.py index 146c144a68..75b90ed837 100644 --- a/tests/test_models/test_losses/test_perceptual_loss.py +++ b/tests/test_models/test_losses/test_perceptual_loss.py @@ -145,3 +145,8 @@ def test_t_perceptual_loss(): # test whether vgg type is valid with pytest.raises(ValueError): TransferalPerceptualLoss(criterion='l2') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_losses/test_pixelwise_loss.py b/tests/test_models/test_losses/test_pixelwise_loss.py index b05d368565..70b037f83b 100644 --- a/tests/test_models/test_losses/test_pixelwise_loss.py +++ b/tests/test_models/test_losses/test_pixelwise_loss.py @@ -112,3 +112,8 @@ def test_pixelwise_losses(): assert loss.item() == 0.0 loss = psnr_loss(target, target) assert loss.item() == -80.0 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_utils/test_bbox_utils.py b/tests/test_models/test_utils/test_bbox_utils.py index 5cc66af038..75935db5a4 100644 --- a/tests/test_models/test_utils/test_bbox_utils.py +++ b/tests/test_models/test_utils/test_bbox_utils.py @@ -121,3 +121,8 @@ def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): trimap = trimap.cuda() raw_alpha = raw_alpha.cuda() return merged, alpha, trimap, raw_alpha + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_utils/test_flow_warp.py b/tests/test_models/test_utils/test_flow_warp.py index 098cd4f600..28e48b21bb 100644 --- a/tests/test_models/test_utils/test_flow_warp.py +++ b/tests/test_models/test_utils/test_flow_warp.py @@ -50,3 +50,8 @@ def test_flow_warp(): assert result.size() == (1, 3, 10, 10) error = torch.sum(torch.abs(result - tensor_shift(x, (1, 1)))) assert error < 1e-5 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_utils/test_model_utils.py b/tests/test_models/test_utils/test_model_utils.py index 70f55e768c..53da9b2d60 100644 --- a/tests/test_models/test_utils/test_model_utils.py +++ b/tests/test_models/test_utils/test_model_utils.py @@ -123,3 +123,8 @@ def forward(self, *args, **kwargs): # remove the registered module MODELS._module_dict.pop('MiniModule') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_utils/test_sampling_utils.py b/tests/test_models/test_utils/test_sampling_utils.py index 4da730ffff..2d4ff54a53 100644 --- a/tests/test_models/test_utils/test_sampling_utils.py +++ b/tests/test_models/test_utils/test_sampling_utils.py @@ -64,3 +64,8 @@ def label_function(num_batches): with pytest.raises(AssertionError): label_sample_fn([0, 10, 2, 3], num_classes=5) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_models/test_utils/test_tensor_utils.py b/tests/test_models/test_utils/test_tensor_utils.py index 22c2e540e6..c06b3a53ee 100644 --- a/tests/test_models/test_utils/test_tensor_utils.py +++ b/tests/test_models/test_utils/test_tensor_utils.py @@ -23,3 +23,8 @@ def l2_norm(a): l2_norm_out = l2_norm(inp) assert (out == l2_norm_out).all() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_structures/test_data_sample.py b/tests/test_structures/test_data_sample.py index 7fe3f3e036..81efd568d1 100644 --- a/tests/test_structures/test_data_sample.py +++ b/tests/test_structures/test_data_sample.py @@ -285,3 +285,8 @@ def test_len(self): empty_data = DataSample( img=torch.randn(3, 3), metainfo=dict(img_shape=[3, 3])) assert len(empty_data) == 1 + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_cli.py b/tests/test_utils/test_cli.py index 2ed0c53b64..a53a459631 100644 --- a/tests/test_utils/test_cli.py +++ b/tests/test_utils/test_cli.py @@ -7,3 +7,8 @@ def test_modify_args(): sys.argv = ['test.py', '--arg_1=1', '--arg-2=2'] modify_args() + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_img_utils.py b/tests/test_utils/test_img_utils.py index 56159cf8b2..d084b3cc04 100644 --- a/tests/test_utils/test_img_utils.py +++ b/tests/test_utils/test_img_utils.py @@ -63,3 +63,8 @@ def test_to_numpy(): input = torch.rand(1, 3, 8, 8) output = to_numpy(input) assert isinstance(output, np.ndarray) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_io_utils.py b/tests/test_utils/test_io_utils.py index a3e8a1b8a3..347b0430ce 100644 --- a/tests/test_utils/test_io_utils.py +++ b/tests/test_utils/test_io_utils.py @@ -9,3 +9,8 @@ def test_download_from_url(): 'https://download.openmmlab.com/mmgen/dataset/singan/balloons.png', dest_path='./') print(dest_path) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_logger.py b/tests/test_utils/test_logger.py index 9cca892caa..ba9d72d50a 100644 --- a/tests/test_utils/test_logger.py +++ b/tests/test_utils/test_logger.py @@ -4,3 +4,8 @@ def test_print_colored_log(): print_colored_log('Test print_colored_log info.') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_sampler.py b/tests/test_utils/test_sampler.py index 5bbbddf643..3fdaa97366 100644 --- a/tests/test_utils/test_sampler.py +++ b/tests/test_utils/test_sampler.py @@ -69,3 +69,8 @@ def test_val_data_sampler(): tar_out = [[0, 1, 2, 3]] for idx, out in enumerate(val_sampler): assert out == tar_out[idx] + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_setup_env.py b/tests/test_utils/test_setup_env.py index 4a599f0437..767fe5535f 100644 --- a/tests/test_utils/test_setup_env.py +++ b/tests/test_utils/test_setup_env.py @@ -10,3 +10,8 @@ def test_try_import(): import numpy as np assert try_import('numpy') is np assert try_import('numpy111') is None + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_utils/test_trans_utils.py b/tests/test_utils/test_trans_utils.py index a7f51b84e3..5ea78e77fb 100644 --- a/tests/test_utils/test_trans_utils.py +++ b/tests/test_utils/test_trans_utils.py @@ -392,3 +392,8 @@ def test_irregular_mask(): mask = get_irregular_mask(img_shape, num_vertices=10) assert mask.shape == (256, 256, 1) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_visualization/test_concat_visualizer.py b/tests/test_visualization/test_concat_visualizer.py index 51636465e2..5c2c0c0494 100644 --- a/tests/test_visualization/test_concat_visualizer.py +++ b/tests/test_visualization/test_concat_visualizer.py @@ -38,3 +38,8 @@ def test_concatimagevisualizer(): for fn in 'rgb_1.png', 'bgr_2.png': img = mmcv.imread(f'work_dirs/vis_data/vis_image/{fn}') assert img.shape == (64, 16 * 3 * 2, 3) + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_visualization/test_vis_backend.py b/tests/test_visualization/test_vis_backend.py index 6bd6ff6689..c1e9547e21 100644 --- a/tests/test_visualization/test_vis_backend.py +++ b/tests/test_visualization/test_vis_backend.py @@ -159,3 +159,8 @@ def test_wandb(self): vis_backend._init_env() _, called_kwargs = wandb_mock.init.call_args self.assertEqual(called_kwargs['name'], f'test_wandb_{timestamp}') + + +def teardown_module(): + import gc + gc.collect() diff --git a/tests/test_visualization/test_visualizer.py b/tests/test_visualization/test_visualizer.py index b7923fe02f..dcd49735bc 100644 --- a/tests/test_visualization/test_visualizer.py +++ b/tests/test_visualization/test_visualizer.py @@ -85,3 +85,8 @@ def test_add_datasample(self): osp.exists(osp.join(img_root, 'fake_img_padding_5.png')) shutil.rmtree(img_root) + + +def teardown_module(): + import gc + gc.collect() From ec5d2c73ca1f60e503570569cc8d58016fd8db83 Mon Sep 17 00:00:00 2001 From: liuwenran <448073814@qq.com> Date: Mon, 4 Sep 2023 19:19:47 +0800 Subject: [PATCH 3/3] add clear --- tests/configs/aot_test.py | 2 ++ tests/configs/deepfillv1_test.py | 2 ++ tests/configs/gl_test.py | 2 ++ tests/configs/one_stage_gl.py | 2 ++ tests/configs/pconv_test.py | 2 ++ tests/configs/two_stage_test.py | 2 ++ tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py | 2 ++ .../test_apis/test_inferencers/test_colorization_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_conditional_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_eg3d_inferencer.py | 2 ++ .../test_inferencers/test_image_super_resolution_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_inference_functions.py | 2 ++ tests/test_apis/test_inferencers/test_inpainting_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_matting_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_mmedit_inferencer.py | 2 ++ tests/test_apis/test_inferencers/test_text2image_inferencers.py | 2 ++ tests/test_apis/test_inferencers/test_translation_inferencer.py | 2 ++ .../test_apis/test_inferencers/test_unconditional_inferencer.py | 2 ++ .../test_inferencers/test_video_interpolation_inferencer.py | 2 ++ .../test_inferencers/test_video_restoration_inferencer.py | 2 ++ tests/test_apis/test_mmagic_inferencer.py | 2 ++ tests/test_datasets/test_basic_conditional_dataset.py | 2 ++ tests/test_datasets/test_basic_frames_dataset.py | 2 ++ tests/test_datasets/test_basic_image_dataset.py | 2 ++ tests/test_datasets/test_categories.py | 2 ++ tests/test_datasets/test_cifar10_dataset.py | 2 ++ tests/test_datasets/test_comp1k_dataset.py | 2 ++ tests/test_datasets/test_controlnet_dataset.py | 2 ++ tests/test_datasets/test_data_utils.py | 2 ++ tests/test_datasets/test_dreambooth_dataset.py | 2 ++ tests/test_datasets/test_grow_scale_image_dataset.py | 2 ++ tests/test_datasets/test_imagenet_dataset.py | 2 ++ tests/test_datasets/test_mscoco_dataset.py | 2 ++ tests/test_datasets/test_paired_image_dataset.py | 2 ++ tests/test_datasets/test_singan_dataset.py | 2 ++ tests/test_datasets/test_transforms/test_albumentations.py | 2 ++ tests/test_datasets/test_transforms/test_alpha.py | 2 ++ tests/test_datasets/test_transforms/test_aug_frames.py | 2 ++ tests/test_datasets/test_transforms/test_aug_pixel.py | 2 ++ tests/test_datasets/test_transforms/test_aug_shape.py | 2 ++ tests/test_datasets/test_transforms/test_blur_kernels.py | 2 ++ tests/test_datasets/test_transforms/test_crop.py | 2 ++ tests/test_datasets/test_transforms/test_fgbg.py | 2 ++ tests/test_datasets/test_transforms/test_formatting.py | 2 ++ tests/test_datasets/test_transforms/test_generate_assistant.py | 2 ++ .../test_transforms/test_generate_frame_indices.py | 2 ++ tests/test_datasets/test_transforms/test_get_masked_image.py | 2 ++ tests/test_datasets/test_transforms/test_loading.py | 2 ++ tests/test_datasets/test_transforms/test_matlab_like_resize.py | 2 ++ tests/test_datasets/test_transforms/test_normalization.py | 2 ++ tests/test_datasets/test_transforms/test_random_degradations.py | 2 ++ .../test_datasets/test_transforms/test_random_down_sampling.py | 2 ++ tests/test_datasets/test_transforms/test_trimap.py | 2 ++ tests/test_datasets/test_transforms/test_values.py | 2 ++ tests/test_datasets/test_unpaired_image_dataset.py | 2 ++ tests/test_engine/test_hooks/test_ema.py | 2 ++ tests/test_engine/test_hooks/test_iter_time_hook.py | 2 ++ tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py | 2 ++ tests/test_engine/test_hooks/test_pickle_data_hook.py | 2 ++ tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py | 2 ++ tests/test_engine/test_hooks/test_visualization_hook.py | 2 ++ .../test_optimizers/test_multi_optimizer_constructor.py | 2 ++ .../test_optimizers/test_pggan_optimizer_constructor.py | 2 ++ .../test_optimizers/test_singan_optimizer_constructor.py | 2 ++ tests/test_engine/test_runner/test_log_processor.py | 2 ++ tests/test_engine/test_runner/test_loop_utils.py | 2 ++ tests/test_engine/test_runner/test_multi_loops.py | 2 ++ .../test_schedulers/test_linear_lr_scheduler_with_interval.py | 2 ++ tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py | 2 ++ tests/test_evaluation/test_evaluator.py | 2 ++ tests/test_evaluation/test_functional/test_fid_inception.py | 2 ++ tests/test_evaluation/test_functional/test_gaussian_funcs.py | 2 ++ tests/test_evaluation/test_functional/test_inception_utils.py | 2 ++ tests/test_evaluation/test_metrics/test_base_gen_metric.py | 2 ++ .../test_metrics/test_base_sample_wise_metric.py | 2 ++ tests/test_evaluation/test_metrics/test_connectivity_error.py | 2 ++ tests/test_evaluation/test_metrics/test_equivariance.py | 2 ++ tests/test_evaluation/test_metrics/test_fid.py | 2 ++ tests/test_evaluation/test_metrics/test_gradient_error.py | 2 ++ tests/test_evaluation/test_metrics/test_inception_score.py | 2 ++ tests/test_evaluation/test_metrics/test_mae.py | 2 ++ tests/test_evaluation/test_metrics/test_matting_mse.py | 2 ++ tests/test_evaluation/test_metrics/test_metrics_utils.py | 2 ++ tests/test_evaluation/test_metrics/test_ms_ssim.py | 2 ++ tests/test_evaluation/test_metrics/test_mse.py | 2 ++ tests/test_evaluation/test_metrics/test_niqe.py | 2 ++ tests/test_evaluation/test_metrics/test_ppl.py | 2 ++ tests/test_evaluation/test_metrics/test_precision_and_recall.py | 2 ++ tests/test_evaluation/test_metrics/test_psnr.py | 2 ++ tests/test_evaluation/test_metrics/test_sad.py | 2 ++ tests/test_evaluation/test_metrics/test_snr.py | 2 ++ tests/test_evaluation/test_metrics/test_ssim.py | 2 ++ tests/test_evaluation/test_metrics/test_swd.py | 2 ++ tests/test_models/test_archs/test_aspp.py | 2 ++ tests/test_models/test_archs/test_conv.py | 2 ++ tests/test_models/test_archs/test_downsample.py | 2 ++ tests/test_models/test_archs/test_ensemble.py | 2 ++ tests/test_models/test_archs/test_gated_conv_module.py | 2 ++ tests/test_models/test_archs/test_img_normalize.py | 2 ++ tests/test_models/test_archs/test_linear_module.py | 2 ++ tests/test_models/test_archs/test_lora.py | 2 ++ tests/test_models/test_archs/test_multi_layer_disc.py | 2 ++ tests/test_models/test_archs/test_patch_disc.py | 2 ++ tests/test_models/test_archs/test_resnet.py | 2 ++ tests/test_models/test_archs/test_separable_conv_module.py | 2 ++ tests/test_models/test_archs/test_simple_encoder_decoder.py | 2 ++ tests/test_models/test_archs/test_smpatch_disc.py | 2 ++ tests/test_models/test_archs/test_sr_backbone.py | 2 ++ tests/test_models/test_archs/test_tokenizer.py | 2 ++ tests/test_models/test_archs/test_upsample.py | 2 ++ tests/test_models/test_archs/test_vgg.py | 2 ++ tests/test_models/test_archs/test_wrapper.py | 2 ++ tests/test_models/test_base_models/test_average_model.py | 2 ++ tests/test_models/test_base_models/test_base_conditional_gan.py | 2 ++ tests/test_models/test_base_models/test_base_edit_model.py | 2 ++ tests/test_models/test_base_models/test_base_gan.py | 2 ++ tests/test_models/test_base_models/test_base_mattor.py | 2 ++ .../test_models/test_base_models/test_base_translation_model.py | 2 ++ tests/test_models/test_base_models/test_basic_interpolator.py | 2 ++ tests/test_models/test_base_models/test_one_stage.py | 2 ++ tests/test_models/test_base_models/test_two_stage.py | 2 ++ .../test_data_preprocessors/test_data_preprocessor.py | 2 ++ .../test_data_preprocessors/test_mattor_preprocessor.py | 2 ++ .../test_diffusion_schedulers/test_ddim_scheduler.py | 2 ++ tests/test_models/test_diffusion_schedulers/test_init.py | 2 ++ tests/test_models/test_editors/test_aotgan/test_aot_decoder.py | 2 ++ tests/test_models/test_editors/test_aotgan/test_aot_encoder.py | 2 ++ .../test_editors/test_aotgan/test_aot_encoder_decoder.py | 2 ++ .../test_models/test_editors/test_aotgan/test_aot_inpaintor.py | 2 ++ tests/test_models/test_editors/test_aotgan/test_aot_neck.py | 2 ++ .../test_editors/test_arcface/test_arcface_modules.py | 2 ++ tests/test_models/test_editors/test_arcface/test_id_loss.py | 2 ++ tests/test_models/test_editors/test_arcface/test_model_irse.py | 2 ++ tests/test_models/test_editors/test_basicvsr/test_basicvsr.py | 2 ++ .../test_models/test_editors/test_basicvsr/test_basicvsr_net.py | 2 ++ .../test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py | 2 ++ tests/test_models/test_editors/test_biggan/test_biggan.py | 2 ++ .../test_editors/test_biggan/test_biggan_deep_discriminator.py | 2 ++ .../test_editors/test_biggan/test_biggan_deep_generator.py | 2 ++ .../test_editors/test_biggan/test_biggan_discriminator.py | 2 ++ .../test_editors/test_biggan/test_biggan_generator.py | 2 ++ .../test_models/test_editors/test_biggan/test_biggan_modules.py | 2 ++ .../test_editors/test_biggan/test_biggan_snmodule.py | 2 ++ tests/test_models/test_editors/test_cain/test_cain.py | 2 ++ tests/test_models/test_editors/test_cain/test_cain_net.py | 2 ++ .../test_models/test_editors/test_controlnet/test_controlnet.py | 2 ++ .../test_editors/test_controlnet/test_controlnet_utils.py | 2 ++ tests/test_models/test_editors/test_cyclegan/test_cyclegan.py | 2 ++ .../test_editors/test_cyclegan/test_cyclegan_generator.py | 2 ++ .../test_editors/test_cyclegan/test_cyclegan_modules.py | 2 ++ tests/test_models/test_editors/test_dcgan/test_dcgan.py | 2 ++ .../test_editors/test_dcgan/test_dcgan_discriminator.py | 2 ++ .../test_models/test_editors/test_dcgan/test_dcgan_generator.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_attention.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_denoising_unet.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_embeddings.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_res_blocks.py | 2 ++ tests/test_models/test_editors/test_ddpm/test_unet_blocks.py | 2 ++ .../test_editors/test_deblurganv2/test_deblurganv2.py | 2 ++ .../test_deblurganv2/test_deblurganv2_discriminator.py | 2 ++ .../test_editors/test_deblurganv2/test_deblurganv2_generator.py | 2 ++ .../test_editors/test_deepfillv1/test_contextual_attention.py | 2 ++ .../test_deepfillv1/test_contextual_attention_neck.py | 2 ++ .../test_editors/test_deepfillv1/test_deepfill_decoder.py | 2 ++ .../test_editors/test_deepfillv1/test_deepfill_disc.py | 2 ++ .../test_editors/test_deepfillv1/test_deepfill_encoder.py | 2 ++ .../test_editors/test_deepfillv1/test_deepfill_refiner.py | 2 ++ .../test_models/test_editors/test_deepfillv1/test_deepfillv1.py | 2 ++ .../test_deepfillv2/test_two_stage_encoder_decoder.py | 2 ++ tests/test_models/test_editors/test_dic/test_dic.py | 2 ++ tests/test_models/test_editors/test_dic/test_dic_net.py | 2 ++ .../test_editors/test_dic/test_feedback_hour_glass.py | 2 ++ tests/test_models/test_editors/test_dic/test_light_cnn.py | 2 ++ tests/test_models/test_editors/test_dim/test_dim.py | 2 ++ .../test_editors/test_disco_diffusion/test_disco_diffusion.py | 2 ++ .../test_disco_diffusion/test_disco_diffusion_clip_wrapper.py | 2 ++ .../test_models/test_editors/test_dreambooth/test_dreambooth.py | 2 ++ tests/test_models/test_editors/test_duf/test_duf.py | 2 ++ tests/test_models/test_editors/test_edsr/test_edsr_net.py | 2 ++ tests/test_models/test_editors/test_edvr/test_edvr.py | 2 ++ tests/test_models/test_editors/test_edvr/test_edvr_net.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_camera.py | 2 ++ .../test_editors/test_eg3d/test_dual_discriminator.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_eg3d.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_ray_sampler.py | 2 ++ tests/test_models/test_editors/test_eg3d/test_renderer.py | 2 ++ tests/test_models/test_editors/test_esrgan/test_esrgan.py | 2 ++ tests/test_models/test_editors/test_esrgan/test_rrdb_net.py | 2 ++ tests/test_models/test_editors/test_fba/test_fba_decoder.py | 2 ++ tests/test_models/test_editors/test_fba/test_fba_encoder.py | 2 ++ tests/test_models/test_editors/test_flavr/test_flavr.py | 2 ++ tests/test_models/test_editors/test_flavr/test_flavr_net.py | 2 ++ tests/test_models/test_editors/test_gca/test_gca.py | 2 ++ tests/test_models/test_editors/test_gca/test_gca_module.py | 2 ++ tests/test_models/test_editors/test_gca/test_resgca_dec.py | 2 ++ tests/test_models/test_editors/test_gca/test_resgca_enc.py | 2 ++ tests/test_models/test_editors/test_ggan/test_ggan.py | 2 ++ .../test_editors/test_glean/test_glean_styleganv2.py | 2 ++ tests/test_models/test_editors/test_glide/test_glide.py | 2 ++ .../test_editors/test_global_local/test_gl_decoder.py | 2 ++ .../test_editors/test_global_local/test_gl_dilation.py | 2 ++ .../test_models/test_editors/test_global_local/test_gl_disc.py | 2 ++ .../test_editors/test_global_local/test_gl_encoder.py | 2 ++ .../test_editors/test_global_local/test_gl_encoder_decoder.py | 2 ++ .../test_editors/test_global_local/test_gl_inpaintor.py | 2 ++ .../test_models/test_editors/test_guided_diffusion/test_adm.py | 2 ++ tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py | 2 ++ tests/test_models/test_editors/test_indexnet/test_indexnet.py | 2 ++ .../test_editors/test_indexnet/test_indexnet_decoder.py | 2 ++ .../test_editors/test_indexnet/test_indexnet_encoder.py | 2 ++ .../test_editors/test_inst_colorization/test_color_utils.py | 2 ++ .../test_inst_colorization/test_colorization_net.py | 2 ++ .../test_editors/test_inst_colorization/test_fusion_net.py | 2 ++ .../test_inst_colorization/test_inst_colorization.py | 2 ++ .../test_editors/test_inst_colorization/test_weight_layer.py | 2 ++ tests/test_models/test_editors/test_liif/test_liif.py | 2 ++ tests/test_models/test_editors/test_liif/test_liif_net.py | 2 ++ tests/test_models/test_editors/test_liif/test_mlp_refiner.py | 2 ++ tests/test_models/test_editors/test_lsgan/test_lsgan.py | 2 ++ .../test_editors/test_lsgan/test_lsgan_discriminator.py | 2 ++ .../test_models/test_editors/test_lsgan/test_lsgan_generator.py | 2 ++ .../test_models/test_editors/test_mspie/test_mspie_stylegan2.py | 2 ++ .../test_mspie/test_mspie_stylegan2_discriminator.py | 2 ++ .../test_editors/test_mspie/test_mspie_stylegan2_generator.py | 2 ++ .../test_editors/test_mspie/test_mspie_stylegan2_modules.py | 2 ++ tests/test_models/test_editors/test_mspie/test_pe_singan.py | 2 ++ .../test_editors/test_mspie/test_pe_singan_generator.py | 2 ++ .../test_editors/test_mspie/test_positional_encoding.py | 2 ++ .../test_models/test_editors/test_nafnet/test_naf_avgpool2d.py | 2 ++ .../test_editors/test_nafnet/test_naf_layernorm2d.py | 2 ++ tests/test_models/test_editors/test_nafnet/test_nafbaseline.py | 2 ++ tests/test_models/test_editors/test_nafnet/test_nafnet.py | 2 ++ .../test_editors/test_pconv/test_mask_conv_module.py | 2 ++ tests/test_models/test_editors/test_pconv/test_partial_conv.py | 2 ++ tests/test_models/test_editors/test_pconv/test_pconv_decoder.py | 2 ++ tests/test_models/test_editors/test_pconv/test_pconv_encoder.py | 2 ++ .../test_editors/test_pconv/test_pconv_encoder_decoder.py | 2 ++ .../test_models/test_editors/test_pconv/test_pconv_inpaintor.py | 2 ++ tests/test_models/test_editors/test_pggan/test_pggan.py | 2 ++ .../test_editors/test_pggan/test_pggan_discriminator.py | 2 ++ .../test_models/test_editors/test_pggan/test_pggan_generator.py | 2 ++ tests/test_models/test_editors/test_pggan/test_pggan_modules.py | 2 ++ tests/test_models/test_editors/test_pix2pix/test_pix2pix.py | 2 ++ .../test_editors/test_pix2pix/test_pix2pix_generator.py | 2 ++ .../test_editors/test_pix2pix/test_pix2pix_modules.py | 2 ++ tests/test_models/test_editors/test_plain/test_plain_decoder.py | 2 ++ tests/test_models/test_editors/test_plain/test_plain_refiner.py | 2 ++ tests/test_models/test_editors/test_rdn/test_rdn_net.py | 2 ++ .../test_editors/test_real_basicvsr/test_real_basicvsr.py | 2 ++ .../test_editors/test_real_basicvsr/test_real_basicvsr_net.py | 2 ++ .../test_editors/test_real_esrgan/test_real_esrgan.py | 2 ++ .../test_models/test_editors/test_real_esrgan/test_unet_disc.py | 2 ++ .../test_editors/test_restormer/test_restormer_net.py | 2 ++ tests/test_models/test_editors/test_sagan/test_sagan.py | 2 ++ .../test_editors/test_sagan/test_sagan_discriminator.py | 2 ++ .../test_models/test_editors/test_sagan/test_sagan_generator.py | 2 ++ tests/test_models/test_editors/test_sagan/test_sagan_modules.py | 2 ++ tests/test_models/test_editors/test_singan/test_singan.py | 2 ++ .../test_editors/test_singan/test_singan_discriminator.py | 2 ++ .../test_editors/test_singan/test_singan_generator.py | 2 ++ .../test_models/test_editors/test_singan/test_singan_modules.py | 2 ++ tests/test_models/test_editors/test_srcnn/test_srcnn_net.py | 2 ++ tests/test_models/test_editors/test_srgan/test_modified_vgg.py | 2 ++ tests/test_models/test_editors/test_srgan/test_sr_resnet.py | 2 ++ tests/test_models/test_editors/test_srgan/test_srgan.py | 2 ++ .../test_editors/test_stable_diffusion/test_clip_wrapper.py | 2 ++ .../test_editors/test_stable_diffusion/test_stable_diffusion.py | 2 ++ .../test_stable_diffusion/test_stable_diffusion_inpaint.py | 2 ++ .../test_stable_diffusion/test_stable_diffusion_tomesd.py | 2 ++ .../test_models/test_editors/test_stable_diffusion/test_vae.py | 2 ++ tests/test_models/test_editors/test_stylegan1/test_stylegan1.py | 2 ++ .../test_editors/test_stylegan1/test_stylegan1_discriminator.py | 2 ++ .../test_editors/test_stylegan1/test_stylegan1_generator.py | 2 ++ .../test_editors/test_stylegan1/test_stylegan1_modules.py | 2 ++ .../test_editors/test_stylegan1/test_stylegan_utils.py | 2 ++ .../test_editors/test_stylegan2/test_ada/test_augment.py | 2 ++ tests/test_models/test_editors/test_stylegan2/test_stylegan2.py | 2 ++ .../test_editors/test_stylegan2/test_stylegan2_discriminator.py | 2 ++ .../test_editors/test_stylegan2/test_stylegan2_generator.py | 2 ++ .../test_editors/test_stylegan2/test_stylegan2_modules.py | 2 ++ tests/test_models/test_editors/test_stylegan3/test_stylegan3.py | 2 ++ .../test_editors/test_stylegan3/test_stylegan3_generator.py | 2 ++ .../test_editors/test_stylegan3/test_stylegan3_modules.py | 2 ++ .../test_editors/test_stylegan3/test_stylegan3_utils.py | 2 ++ .../test_models/test_editors/test_swinir/test_swinir_modules.py | 2 ++ tests/test_models/test_editors/test_swinir/test_swinir_net.py | 2 ++ tests/test_models/test_editors/test_swinir/test_swinir_rstb.py | 2 ++ tests/test_models/test_editors/test_swinir/test_swinir_utils.py | 2 ++ tests/test_models/test_editors/test_tdan/test_tdan.py | 2 ++ tests/test_models/test_editors/test_tdan/test_tdan_net.py | 2 ++ tests/test_models/test_editors/test_tof/test_tof_vfi_net.py | 2 ++ tests/test_models/test_editors/test_tof/test_tof_vsr_net.py | 2 ++ tests/test_models/test_editors/test_ttsr/test_lte.py | 2 ++ .../test_editors/test_ttsr/test_search_transformer.py | 2 ++ tests/test_models/test_editors/test_ttsr/test_ttsr.py | 2 ++ tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py | 2 ++ tests/test_models/test_editors/test_ttsr/test_ttsr_net.py | 2 ++ .../test_editors/test_wgan_gp/test_wgan_discriminator.py | 2 ++ .../test_editors/test_wgan_gp/test_wgan_generator.py | 2 ++ tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py | 2 ++ .../test_editors/test_wgan_gp/test_wgan_gp_module.py | 2 ++ tests/test_models/test_losses/test_clip_loss.py | 2 ++ tests/test_models/test_losses/test_composition_loss.py | 2 ++ tests/test_models/test_losses/test_face_id_loss.py | 2 ++ tests/test_models/test_losses/test_feature_loss.py | 2 ++ tests/test_models/test_losses/test_gan_loss.py | 2 ++ tests/test_models/test_losses/test_gradient_loss.py | 2 ++ .../test_losses/test_loss_comps/test_clip_loss_comps.py | 2 ++ .../test_loss_comps/test_disc_auxiliary_loss_comps.py | 2 ++ .../test_losses/test_loss_comps/test_face_id_loss_comps.py | 2 ++ .../test_losses/test_loss_comps/test_gan_loss_comps.py | 2 ++ .../test_loss_comps/test_gen_auxiliary_loss_comps.py | 2 ++ tests/test_models/test_losses/test_loss_wrapper.py | 2 ++ tests/test_models/test_losses/test_perceptual_loss.py | 2 ++ tests/test_models/test_losses/test_pixelwise_loss.py | 2 ++ tests/test_models/test_utils/test_bbox_utils.py | 2 ++ tests/test_models/test_utils/test_flow_warp.py | 2 ++ tests/test_models/test_utils/test_model_utils.py | 2 ++ tests/test_models/test_utils/test_sampling_utils.py | 2 ++ tests/test_models/test_utils/test_tensor_utils.py | 2 ++ tests/test_structures/test_data_sample.py | 2 ++ tests/test_utils/test_cli.py | 2 ++ tests/test_utils/test_img_utils.py | 2 ++ tests/test_utils/test_io_utils.py | 2 ++ tests/test_utils/test_logger.py | 2 ++ tests/test_utils/test_sampler.py | 2 ++ tests/test_utils/test_setup_env.py | 2 ++ tests/test_utils/test_trans_utils.py | 2 ++ tests/test_visualization/test_concat_visualizer.py | 2 ++ tests/test_visualization/test_vis_backend.py | 2 ++ tests/test_visualization/test_visualizer.py | 2 ++ 335 files changed, 670 insertions(+) diff --git a/tests/configs/aot_test.py b/tests/configs/aot_test.py index 70c8e5ab5a..d06e71a4da 100644 --- a/tests/configs/aot_test.py +++ b/tests/configs/aot_test.py @@ -58,3 +58,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/configs/deepfillv1_test.py b/tests/configs/deepfillv1_test.py index c84fc25d7f..5854f3da32 100644 --- a/tests/configs/deepfillv1_test.py +++ b/tests/configs/deepfillv1_test.py @@ -70,3 +70,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/configs/gl_test.py b/tests/configs/gl_test.py index 583c02b067..28accb3ac1 100644 --- a/tests/configs/gl_test.py +++ b/tests/configs/gl_test.py @@ -135,3 +135,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/configs/one_stage_gl.py b/tests/configs/one_stage_gl.py index 82cb52ecfd..b71978801c 100644 --- a/tests/configs/one_stage_gl.py +++ b/tests/configs/one_stage_gl.py @@ -46,3 +46,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/configs/pconv_test.py b/tests/configs/pconv_test.py index 74aff22e1a..1bbda67f46 100644 --- a/tests/configs/pconv_test.py +++ b/tests/configs/pconv_test.py @@ -48,3 +48,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/configs/two_stage_test.py b/tests/configs/two_stage_test.py index d111a08ba1..33cd8b49cc 100644 --- a/tests/configs/two_stage_test.py +++ b/tests/configs/two_stage_test.py @@ -111,3 +111,5 @@ def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py b/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py index 5bc0564f79..7e61bccb1f 100644 --- a/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py +++ b/tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py @@ -28,3 +28,5 @@ def test_base_mmagic_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_colorization_inferencer.py b/tests/test_apis/test_inferencers/test_colorization_inferencer.py index 0ecc7cbfee..6ba11327bc 100644 --- a/tests/test_apis/test_inferencers/test_colorization_inferencer.py +++ b/tests/test_apis/test_inferencers/test_colorization_inferencer.py @@ -49,3 +49,5 @@ def test_colorization_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_conditional_inferencer.py b/tests/test_apis/test_inferencers/test_conditional_inferencer.py index 8e119e0a62..f177c914ae 100644 --- a/tests/test_apis/test_inferencers/test_conditional_inferencer.py +++ b/tests/test_apis/test_inferencers/test_conditional_inferencer.py @@ -29,3 +29,5 @@ def test_conditional_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_eg3d_inferencer.py b/tests/test_apis/test_inferencers/test_eg3d_inferencer.py index ede4196dcf..08255d3d42 100644 --- a/tests/test_apis/test_inferencers/test_eg3d_inferencer.py +++ b/tests/test_apis/test_inferencers/test_eg3d_inferencer.py @@ -162,3 +162,5 @@ def test_eg3d_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py b/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py index d7230c9644..99d82c3cf1 100644 --- a/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py +++ b/tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py @@ -35,3 +35,5 @@ def test_image_super_resolution_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_inference_functions.py b/tests/test_apis/test_inferencers/test_inference_functions.py index 9677b31822..75e98d1a9f 100644 --- a/tests/test_apis/test_inferencers/test_inference_functions.py +++ b/tests/test_apis/test_inferencers/test_inference_functions.py @@ -30,3 +30,5 @@ def test_calculate_grid_size(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_inpainting_inferencer.py b/tests/test_apis/test_inferencers/test_inpainting_inferencer.py index 5139853f2a..c9e44058a0 100644 --- a/tests/test_apis/test_inferencers/test_inpainting_inferencer.py +++ b/tests/test_apis/test_inferencers/test_inpainting_inferencer.py @@ -35,3 +35,5 @@ def test_inpainting_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_matting_inferencer.py b/tests/test_apis/test_inferencers/test_matting_inferencer.py index 4b513955db..f7ff1d3dfa 100644 --- a/tests/test_apis/test_inferencers/test_matting_inferencer.py +++ b/tests/test_apis/test_inferencers/test_matting_inferencer.py @@ -27,3 +27,5 @@ def test_matting_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_mmedit_inferencer.py b/tests/test_apis/test_inferencers/test_mmedit_inferencer.py index 4f7443f139..fa8685014a 100644 --- a/tests/test_apis/test_inferencers/test_mmedit_inferencer.py +++ b/tests/test_apis/test_inferencers/test_mmedit_inferencer.py @@ -61,3 +61,5 @@ def test_mmagic_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_text2image_inferencers.py b/tests/test_apis/test_inferencers/test_text2image_inferencers.py index c2caeacbe7..0aba69eb4a 100644 --- a/tests/test_apis/test_inferencers/test_text2image_inferencers.py +++ b/tests/test_apis/test_inferencers/test_text2image_inferencers.py @@ -111,3 +111,5 @@ def test_translation(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_translation_inferencer.py b/tests/test_apis/test_inferencers/test_translation_inferencer.py index f273de88c9..ebc003bd63 100644 --- a/tests/test_apis/test_inferencers/test_translation_inferencer.py +++ b/tests/test_apis/test_inferencers/test_translation_inferencer.py @@ -31,3 +31,5 @@ def test_translation_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_unconditional_inferencer.py b/tests/test_apis/test_inferencers/test_unconditional_inferencer.py index 8dd8eb6b26..9618e1806a 100644 --- a/tests/test_apis/test_inferencers/test_unconditional_inferencer.py +++ b/tests/test_apis/test_inferencers/test_unconditional_inferencer.py @@ -55,3 +55,5 @@ def test_unconditional_inferencer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py b/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py index bc1aa36b58..c40019bec2 100644 --- a/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py +++ b/tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py @@ -61,3 +61,5 @@ def test_video_interpolation_inferencer_fps_multiplier(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py b/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py index 9dc8950ffb..cdb389aa3d 100644 --- a/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py +++ b/tests/test_apis/test_inferencers/test_video_restoration_inferencer.py @@ -94,3 +94,5 @@ def test_video_restoration_inferencer_max_seq_len(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_apis/test_mmagic_inferencer.py b/tests/test_apis/test_mmagic_inferencer.py index 15965f440b..e4c7a08523 100644 --- a/tests/test_apis/test_mmagic_inferencer.py +++ b/tests/test_apis/test_mmagic_inferencer.py @@ -59,3 +59,5 @@ def test_edit(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_basic_conditional_dataset.py b/tests/test_datasets/test_basic_conditional_dataset.py index 037f8cb993..c4630a3e46 100644 --- a/tests/test_datasets/test_basic_conditional_dataset.py +++ b/tests/test_datasets/test_basic_conditional_dataset.py @@ -100,3 +100,5 @@ def test_init(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_basic_frames_dataset.py b/tests/test_datasets/test_basic_frames_dataset.py index 0ffe5b870b..3336d7cff3 100644 --- a/tests/test_datasets/test_basic_frames_dataset.py +++ b/tests/test_datasets/test_basic_frames_dataset.py @@ -703,3 +703,5 @@ def test_vfi_ann_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_basic_image_dataset.py b/tests/test_datasets/test_basic_image_dataset.py index dcbfe1bc10..4871cb6e30 100644 --- a/tests/test_datasets/test_basic_image_dataset.py +++ b/tests/test_datasets/test_basic_image_dataset.py @@ -175,3 +175,5 @@ def test_refsr_folder_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_categories.py b/tests/test_datasets/test_categories.py index 271364fe39..0d5f288450 100644 --- a/tests/test_datasets/test_categories.py +++ b/tests/test_datasets/test_categories.py @@ -13,3 +13,5 @@ def test_imagenet_categories(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_cifar10_dataset.py b/tests/test_datasets/test_cifar10_dataset.py index 2805e950ce..9ce8df738c 100644 --- a/tests/test_datasets/test_cifar10_dataset.py +++ b/tests/test_datasets/test_cifar10_dataset.py @@ -177,3 +177,5 @@ def tearDownClass(cls): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_comp1k_dataset.py b/tests/test_datasets/test_comp1k_dataset.py index 03233f836c..0aa0fd0ac4 100644 --- a/tests/test_datasets/test_comp1k_dataset.py +++ b/tests/test_datasets/test_comp1k_dataset.py @@ -78,3 +78,5 @@ def test_comp1k_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_controlnet_dataset.py b/tests/test_datasets/test_controlnet_dataset.py index 852ccd4deb..ec97047922 100644 --- a/tests/test_datasets/test_controlnet_dataset.py +++ b/tests/test_datasets/test_controlnet_dataset.py @@ -27,3 +27,5 @@ def test_controlnet_dataset(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_data_utils.py b/tests/test_datasets/test_data_utils.py index 5cb614777a..a18678134e 100644 --- a/tests/test_datasets/test_data_utils.py +++ b/tests/test_datasets/test_data_utils.py @@ -25,3 +25,5 @@ def test_infer_io_backend(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_dreambooth_dataset.py b/tests/test_datasets/test_dreambooth_dataset.py index 7f2036abbd..24776bd63f 100644 --- a/tests/test_datasets/test_dreambooth_dataset.py +++ b/tests/test_datasets/test_dreambooth_dataset.py @@ -23,3 +23,5 @@ def test_dreambooth_dataset(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_grow_scale_image_dataset.py b/tests/test_datasets/test_grow_scale_image_dataset.py index fe0f4d3a63..c0b1249d6e 100644 --- a/tests/test_datasets/test_grow_scale_image_dataset.py +++ b/tests/test_datasets/test_grow_scale_image_dataset.py @@ -104,3 +104,5 @@ def test_dynamic_unconditional_img_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_imagenet_dataset.py b/tests/test_datasets/test_imagenet_dataset.py index 6718622383..1e46fdf9e9 100644 --- a/tests/test_datasets/test_imagenet_dataset.py +++ b/tests/test_datasets/test_imagenet_dataset.py @@ -19,3 +19,5 @@ def test_load_data_list(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_mscoco_dataset.py b/tests/test_datasets/test_mscoco_dataset.py index e5940cb498..bcc6d390ad 100644 --- a/tests/test_datasets/test_mscoco_dataset.py +++ b/tests/test_datasets/test_mscoco_dataset.py @@ -34,3 +34,5 @@ def test_mscoco(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_paired_image_dataset.py b/tests/test_datasets/test_paired_image_dataset.py index 614b227a1b..837c063cc0 100644 --- a/tests/test_datasets/test_paired_image_dataset.py +++ b/tests/test_datasets/test_paired_image_dataset.py @@ -56,3 +56,5 @@ def test_paired_image_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_singan_dataset.py b/tests/test_datasets/test_singan_dataset.py index 984e77ff74..24bfb8f744 100644 --- a/tests/test_datasets/test_singan_dataset.py +++ b/tests/test_datasets/test_singan_dataset.py @@ -45,3 +45,5 @@ def test_singan_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_albumentations.py b/tests/test_datasets/test_transforms/test_albumentations.py index ea5421eb4e..32971ed151 100644 --- a/tests/test_datasets/test_transforms/test_albumentations.py +++ b/tests/test_datasets/test_transforms/test_albumentations.py @@ -18,3 +18,5 @@ def test_albumentations(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_alpha.py b/tests/test_datasets/test_transforms/test_alpha.py index 0e967e166e..b1cfecba27 100644 --- a/tests/test_datasets/test_transforms/test_alpha.py +++ b/tests/test_datasets/test_transforms/test_alpha.py @@ -89,3 +89,5 @@ def test_generate_soft_seg(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_aug_frames.py b/tests/test_datasets/test_transforms/test_aug_frames.py index 1ad4008f6b..4163d58d56 100644 --- a/tests/test_datasets/test_transforms/test_aug_frames.py +++ b/tests/test_datasets/test_transforms/test_aug_frames.py @@ -99,3 +99,5 @@ def test_temporal_reverse(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_aug_pixel.py b/tests/test_datasets/test_transforms/test_aug_pixel.py index 7278e060fe..14d4ed4c9e 100644 --- a/tests/test_datasets/test_transforms/test_aug_pixel.py +++ b/tests/test_datasets/test_transforms/test_aug_pixel.py @@ -269,3 +269,5 @@ def test_unsharp_masking(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_aug_shape.py b/tests/test_datasets/test_transforms/test_aug_shape.py index c9d268ed88..e162a3cd77 100644 --- a/tests/test_datasets/test_transforms/test_aug_shape.py +++ b/tests/test_datasets/test_transforms/test_aug_shape.py @@ -374,3 +374,5 @@ def test_numpy_pad(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_blur_kernels.py b/tests/test_datasets/test_transforms/test_blur_kernels.py index 560665e11b..07a437aece 100644 --- a/tests/test_datasets/test_transforms/test_blur_kernels.py +++ b/tests/test_datasets/test_transforms/test_blur_kernels.py @@ -15,3 +15,5 @@ def test_blur_kernels(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_crop.py b/tests/test_datasets/test_transforms/test_crop.py index da46212909..772739a5cd 100644 --- a/tests/test_datasets/test_transforms/test_crop.py +++ b/tests/test_datasets/test_transforms/test_crop.py @@ -388,3 +388,5 @@ def test_instance_crop(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_fgbg.py b/tests/test_datasets/test_transforms/test_fgbg.py index 3aa85b1bda..b53abef8a8 100644 --- a/tests/test_datasets/test_transforms/test_fgbg.py +++ b/tests/test_datasets/test_transforms/test_fgbg.py @@ -170,3 +170,5 @@ def test_random_load_resize_bg(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_formatting.py b/tests/test_datasets/test_transforms/test_formatting.py index 3809a47d3e..93e7853202 100644 --- a/tests/test_datasets/test_transforms/test_formatting.py +++ b/tests/test_datasets/test_transforms/test_formatting.py @@ -110,3 +110,5 @@ def test_pack_inputs(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_generate_assistant.py b/tests/test_datasets/test_transforms/test_generate_assistant.py index 5d5f2c55e3..f4392c1990 100644 --- a/tests/test_datasets/test_transforms/test_generate_assistant.py +++ b/tests/test_datasets/test_transforms/test_generate_assistant.py @@ -79,3 +79,5 @@ def test_generate_facial_heatmap(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_generate_frame_indices.py b/tests/test_datasets/test_transforms/test_generate_frame_indices.py index 8a79fd4301..d032b35609 100644 --- a/tests/test_datasets/test_transforms/test_generate_frame_indices.py +++ b/tests/test_datasets/test_transforms/test_generate_frame_indices.py @@ -238,3 +238,5 @@ def test_frame_index_generation_for_recurrent(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_get_masked_image.py b/tests/test_datasets/test_transforms/test_get_masked_image.py index dafe6549ac..cd566e99fe 100644 --- a/tests/test_datasets/test_transforms/test_get_masked_image.py +++ b/tests/test_datasets/test_transforms/test_get_masked_image.py @@ -37,3 +37,5 @@ def test_masked_img(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_loading.py b/tests/test_datasets/test_transforms/test_loading.py index 31423e8265..6597a3f299 100644 --- a/tests/test_datasets/test_transforms/test_loading.py +++ b/tests/test_datasets/test_transforms/test_loading.py @@ -301,3 +301,5 @@ def test_load_mask(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_matlab_like_resize.py b/tests/test_datasets/test_transforms/test_matlab_like_resize.py index f15283ee8b..48c011cb84 100644 --- a/tests/test_datasets/test_transforms/test_matlab_like_resize.py +++ b/tests/test_datasets/test_transforms/test_matlab_like_resize.py @@ -40,3 +40,5 @@ def test_matlab_like_resize(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_normalization.py b/tests/test_datasets/test_transforms/test_normalization.py index 3a95212621..5d850d89cb 100644 --- a/tests/test_datasets/test_transforms/test_normalization.py +++ b/tests/test_datasets/test_transforms/test_normalization.py @@ -138,3 +138,5 @@ def test_rescale_to_zero_one(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_random_degradations.py b/tests/test_datasets/test_transforms/test_random_degradations.py index 6e37f056f1..5625b799e6 100644 --- a/tests/test_datasets/test_transforms/test_random_degradations.py +++ b/tests/test_datasets/test_transforms/test_random_degradations.py @@ -456,3 +456,5 @@ def test_degradations_with_shuffle(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_random_down_sampling.py b/tests/test_datasets/test_transforms/test_random_down_sampling.py index aaae0b6635..7aba5e47a7 100644 --- a/tests/test_datasets/test_transforms/test_random_down_sampling.py +++ b/tests/test_datasets/test_transforms/test_random_down_sampling.py @@ -46,3 +46,5 @@ def test_random_down_sampling(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_trimap.py b/tests/test_datasets/test_transforms/test_trimap.py index 0da0c7a411..40df99e61e 100644 --- a/tests/test_datasets/test_transforms/test_trimap.py +++ b/tests/test_datasets/test_transforms/test_trimap.py @@ -234,3 +234,5 @@ def test_transform_trimap(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_transforms/test_values.py b/tests/test_datasets/test_transforms/test_values.py index 810f00b3b3..911a04646e 100644 --- a/tests/test_datasets/test_transforms/test_values.py +++ b/tests/test_datasets/test_transforms/test_values.py @@ -66,3 +66,5 @@ def test_set_value(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_datasets/test_unpaired_image_dataset.py b/tests/test_datasets/test_unpaired_image_dataset.py index 80b0f731f5..4b7ff1bf82 100644 --- a/tests/test_datasets/test_unpaired_image_dataset.py +++ b/tests/test_datasets/test_unpaired_image_dataset.py @@ -64,3 +64,5 @@ def test_unpaired_image_dataset(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_ema.py b/tests/test_engine/test_hooks/test_ema.py index 86cf6665aa..c6cac31e8e 100644 --- a/tests/test_engine/test_hooks/test_ema.py +++ b/tests/test_engine/test_hooks/test_ema.py @@ -257,3 +257,5 @@ def test_ema_hook_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_iter_time_hook.py b/tests/test_engine/test_hooks/test_iter_time_hook.py index f73c8d9488..45e84ff9c7 100644 --- a/tests/test_engine/test_hooks/test_iter_time_hook.py +++ b/tests/test_engine/test_hooks/test_iter_time_hook.py @@ -74,3 +74,5 @@ def test_after_iter(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py b/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py index 6fb629c9db..3b83b9a420 100644 --- a/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py +++ b/tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py @@ -136,3 +136,5 @@ def test_before_train_iter(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_pickle_data_hook.py b/tests/test_engine/test_hooks/test_pickle_data_hook.py index a60b7d9e91..2d6651400c 100644 --- a/tests/test_engine/test_hooks/test_pickle_data_hook.py +++ b/tests/test_engine/test_hooks/test_pickle_data_hook.py @@ -46,3 +46,5 @@ def test_PickleDataHook(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py b/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py index 2761442ec2..eaae78c583 100644 --- a/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py +++ b/tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py @@ -118,3 +118,5 @@ def test_reduce_lr_scheduler_hook(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_hooks/test_visualization_hook.py b/tests/test_engine/test_hooks/test_visualization_hook.py index b26ebcd14c..267af16bef 100644 --- a/tests/test_engine/test_hooks/test_visualization_hook.py +++ b/tests/test_engine/test_hooks/test_visualization_hook.py @@ -621,3 +621,5 @@ def test_after_test_iter(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py index c49ff9fcee..ef4fb7eca6 100644 --- a/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py @@ -142,3 +142,5 @@ def test_optimizer_constructor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py index 1d8beed43b..e064502577 100644 --- a/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py @@ -95,3 +95,5 @@ def test(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py b/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py index e4364e3fa2..3fb138dcb2 100644 --- a/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py +++ b/tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py @@ -65,3 +65,5 @@ def test(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_runner/test_log_processor.py b/tests/test_engine/test_runner/test_log_processor.py index 3e633d4685..e6389e1d47 100644 --- a/tests/test_engine/test_runner/test_log_processor.py +++ b/tests/test_engine/test_runner/test_log_processor.py @@ -31,3 +31,5 @@ def test_get_dataloader_size(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_runner/test_loop_utils.py b/tests/test_engine/test_runner/test_loop_utils.py index 6e357661c2..d873ee43eb 100644 --- a/tests/test_engine/test_runner/test_loop_utils.py +++ b/tests/test_engine/test_runner/test_loop_utils.py @@ -67,3 +67,5 @@ def test_update_and_check_evaluator(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_runner/test_multi_loops.py b/tests/test_engine/test_runner/test_multi_loops.py index 327cc06e99..a25e6be94f 100644 --- a/tests/test_engine/test_runner/test_multi_loops.py +++ b/tests/test_engine/test_runner/test_multi_loops.py @@ -210,3 +210,5 @@ def test_run(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py b/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py index 0bd46a7fb4..d273d59e21 100644 --- a/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py +++ b/tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py @@ -59,3 +59,5 @@ def test_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py b/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py index 2e4cececa9..834873977d 100644 --- a/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py +++ b/tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py @@ -110,3 +110,5 @@ def test_reduce_lr_scheduler(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_evaluator.py b/tests/test_evaluation/test_evaluator.py index 602564fd8d..866594edc6 100644 --- a/tests/test_evaluation/test_evaluator.py +++ b/tests/test_evaluation/test_evaluator.py @@ -213,3 +213,5 @@ def test_evalute(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_functional/test_fid_inception.py b/tests/test_evaluation/test_functional/test_fid_inception.py index 7996bc3c80..1aca623705 100644 --- a/tests/test_evaluation/test_functional/test_fid_inception.py +++ b/tests/test_evaluation/test_functional/test_fid_inception.py @@ -46,3 +46,5 @@ def test_load_fid_inception(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_functional/test_gaussian_funcs.py b/tests/test_evaluation/test_functional/test_gaussian_funcs.py index 0014ca2918..45f8ad470a 100644 --- a/tests/test_evaluation/test_functional/test_gaussian_funcs.py +++ b/tests/test_evaluation/test_functional/test_gaussian_funcs.py @@ -13,3 +13,5 @@ def test_gauss_gradient(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_functional/test_inception_utils.py b/tests/test_evaluation/test_functional/test_inception_utils.py index 0e38a470e3..daa0887f9a 100644 --- a/tests/test_evaluation/test_functional/test_inception_utils.py +++ b/tests/test_evaluation/test_functional/test_inception_utils.py @@ -69,3 +69,5 @@ def test_vgg_feat_cache_name_args(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_base_gen_metric.py b/tests/test_evaluation/test_metrics/test_base_gen_metric.py index db08a54170..9159003242 100644 --- a/tests/test_evaluation/test_metrics/test_base_gen_metric.py +++ b/tests/test_evaluation/test_metrics/test_base_gen_metric.py @@ -122,3 +122,5 @@ def side_effect(index): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py b/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py index 4727b73d5b..617a54d7bc 100644 --- a/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py +++ b/tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py @@ -93,3 +93,5 @@ def test_prepare(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_connectivity_error.py b/tests/test_evaluation/test_metrics/test_connectivity_error.py index a296910664..4da359ef3a 100644 --- a/tests/test_evaluation/test_metrics/test_connectivity_error.py +++ b/tests/test_evaluation/test_metrics/test_connectivity_error.py @@ -109,3 +109,5 @@ def test_connectivity_error(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_equivariance.py b/tests/test_evaluation/test_metrics/test_equivariance.py index f03cfc2c9f..d31e92f44a 100644 --- a/tests/test_evaluation/test_metrics/test_equivariance.py +++ b/tests/test_evaluation/test_metrics/test_equivariance.py @@ -72,3 +72,5 @@ def test_eq_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_fid.py b/tests/test_evaluation/test_metrics/test_fid.py index d649b51096..78f98bd0fe 100644 --- a/tests/test_evaluation/test_metrics/test_fid.py +++ b/tests/test_evaluation/test_metrics/test_fid.py @@ -282,3 +282,5 @@ def test_trans_fid_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_gradient_error.py b/tests/test_evaluation/test_metrics/test_gradient_error.py index 8dc4a74811..b9826e28f0 100644 --- a/tests/test_evaluation/test_metrics/test_gradient_error.py +++ b/tests/test_evaluation/test_metrics/test_gradient_error.py @@ -106,3 +106,5 @@ def test_gradient_error(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_inception_score.py b/tests/test_evaluation/test_metrics/test_inception_score.py index b097bd2f38..5c4119d15d 100644 --- a/tests/test_evaluation/test_metrics/test_inception_score.py +++ b/tests/test_evaluation/test_metrics/test_inception_score.py @@ -235,3 +235,5 @@ def test_trans_is_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_mae.py b/tests/test_evaluation/test_metrics/test_mae.py index 23683e41ac..30ba2e5889 100644 --- a/tests/test_evaluation/test_metrics/test_mae.py +++ b/tests/test_evaluation/test_metrics/test_mae.py @@ -54,3 +54,5 @@ def test_mae(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_matting_mse.py b/tests/test_evaluation/test_metrics/test_matting_mse.py index 4a57c27fe6..5946943d22 100644 --- a/tests/test_evaluation/test_metrics/test_matting_mse.py +++ b/tests/test_evaluation/test_metrics/test_matting_mse.py @@ -109,3 +109,5 @@ def test_mse(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_metrics_utils.py b/tests/test_evaluation/test_metrics/test_metrics_utils.py index 702b156943..f116bbc82f 100644 --- a/tests/test_evaluation/test_metrics/test_metrics_utils.py +++ b/tests/test_evaluation/test_metrics/test_metrics_utils.py @@ -54,3 +54,5 @@ def test_reorder_image(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_ms_ssim.py b/tests/test_evaluation/test_metrics/test_ms_ssim.py index 33f1e7d733..6907649ba4 100644 --- a/tests/test_evaluation/test_metrics/test_ms_ssim.py +++ b/tests/test_evaluation/test_metrics/test_ms_ssim.py @@ -67,3 +67,5 @@ def test_process_and_evaluate(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_mse.py b/tests/test_evaluation/test_metrics/test_mse.py index e5cded9fbe..176b7ef741 100644 --- a/tests/test_evaluation/test_metrics/test_mse.py +++ b/tests/test_evaluation/test_metrics/test_mse.py @@ -54,3 +54,5 @@ def test_mse(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_niqe.py b/tests/test_evaluation/test_metrics/test_niqe.py index 1949e3d33f..2384093eb7 100644 --- a/tests/test_evaluation/test_metrics/test_niqe.py +++ b/tests/test_evaluation/test_metrics/test_niqe.py @@ -85,3 +85,5 @@ def test_calculate_niqe(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_ppl.py b/tests/test_evaluation/test_metrics/test_ppl.py index 1e320bc8f7..65a2739e53 100644 --- a/tests/test_evaluation/test_metrics/test_ppl.py +++ b/tests/test_evaluation/test_metrics/test_ppl.py @@ -130,3 +130,5 @@ def test_ppl_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_precision_and_recall.py b/tests/test_evaluation/test_metrics/test_precision_and_recall.py index e0387d6261..2b56ceedb0 100644 --- a/tests/test_evaluation/test_metrics/test_precision_and_recall.py +++ b/tests/test_evaluation/test_metrics/test_precision_and_recall.py @@ -102,3 +102,5 @@ def test_pr_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_psnr.py b/tests/test_evaluation/test_metrics/test_psnr.py index 215ce97f3c..50b76be0ad 100644 --- a/tests/test_evaluation/test_metrics/test_psnr.py +++ b/tests/test_evaluation/test_metrics/test_psnr.py @@ -91,3 +91,5 @@ def test_psnr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_sad.py b/tests/test_evaluation/test_metrics/test_sad.py index 232ddeba4a..f6cd5d46cf 100644 --- a/tests/test_evaluation/test_metrics/test_sad.py +++ b/tests/test_evaluation/test_metrics/test_sad.py @@ -109,3 +109,5 @@ def test_sad(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_snr.py b/tests/test_evaluation/test_metrics/test_snr.py index 0d6fb8f2da..9c07f1e088 100644 --- a/tests/test_evaluation/test_metrics/test_snr.py +++ b/tests/test_evaluation/test_metrics/test_snr.py @@ -93,3 +93,5 @@ def test_snr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_ssim.py b/tests/test_evaluation/test_metrics/test_ssim.py index 1e670a3d92..b45fa4ccda 100644 --- a/tests/test_evaluation/test_metrics/test_ssim.py +++ b/tests/test_evaluation/test_metrics/test_ssim.py @@ -79,3 +79,5 @@ def test_calculate_ssim(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_evaluation/test_metrics/test_swd.py b/tests/test_evaluation/test_metrics/test_swd.py index 8798e876be..469c3056a4 100644 --- a/tests/test_evaluation/test_metrics/test_swd.py +++ b/tests/test_evaluation/test_metrics/test_swd.py @@ -90,3 +90,5 @@ def test_prosess(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_aspp.py b/tests/test_models/test_archs/test_aspp.py index edd861eca8..ed9a6839bc 100644 --- a/tests/test_models/test_archs/test_aspp.py +++ b/tests/test_models/test_archs/test_aspp.py @@ -36,3 +36,5 @@ def test_aspp(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_conv.py b/tests/test_models/test_archs/test_conv.py index 07dd8e9ed1..c8f2e45dc9 100644 --- a/tests/test_models/test_archs/test_conv.py +++ b/tests/test_models/test_archs/test_conv.py @@ -9,3 +9,5 @@ def test_conv(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_downsample.py b/tests/test_models/test_archs/test_downsample.py index ae445d5d18..97b7c91ea6 100644 --- a/tests/test_models/test_archs/test_downsample.py +++ b/tests/test_models/test_archs/test_downsample.py @@ -26,3 +26,5 @@ def test_pixel_unshuffle(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_ensemble.py b/tests/test_models/test_archs/test_ensemble.py index b9f9ac5931..0575f285f5 100644 --- a/tests/test_models/test_archs/test_ensemble.py +++ b/tests/test_models/test_archs/test_ensemble.py @@ -70,3 +70,5 @@ def test_ensemble_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_gated_conv_module.py b/tests/test_models/test_archs/test_gated_conv_module.py index 0f7af1c618..b16401e002 100644 --- a/tests/test_models/test_archs/test_gated_conv_module.py +++ b/tests/test_models/test_archs/test_gated_conv_module.py @@ -38,3 +38,5 @@ def test_gated_conv(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_img_normalize.py b/tests/test_models/test_archs/test_img_normalize.py index 11287fb433..e2e415e6ca 100644 --- a/tests/test_models/test_archs/test_img_normalize.py +++ b/tests/test_models/test_archs/test_img_normalize.py @@ -25,3 +25,5 @@ def test_normalize_layer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_linear_module.py b/tests/test_models/test_archs/test_linear_module.py index 9348000035..1b4e965b99 100644 --- a/tests/test_models/test_archs/test_linear_module.py +++ b/tests/test_models/test_archs/test_linear_module.py @@ -51,3 +51,5 @@ def test_linear_module(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_lora.py b/tests/test_models/test_archs/test_lora.py index 20e93de046..e96e408791 100644 --- a/tests/test_models/test_archs/test_lora.py +++ b/tests/test_models/test_archs/test_lora.py @@ -131,3 +131,5 @@ def test_set_lora(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_multi_layer_disc.py b/tests/test_models/test_archs/test_multi_layer_disc.py index 24f6420029..890197e063 100644 --- a/tests/test_models/test_archs/test_multi_layer_disc.py +++ b/tests/test_models/test_archs/test_multi_layer_disc.py @@ -90,3 +90,5 @@ def test_multi_layer_disc(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_patch_disc.py b/tests/test_models/test_archs/test_patch_disc.py index 3d2408af23..d860b5ab6a 100644 --- a/tests/test_models/test_archs/test_patch_disc.py +++ b/tests/test_models/test_archs/test_patch_disc.py @@ -64,3 +64,5 @@ def test_patch_discriminator(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_resnet.py b/tests/test_models/test_archs/test_resnet.py index 823ccc9324..60769d1378 100644 --- a/tests/test_models/test_archs/test_resnet.py +++ b/tests/test_models/test_archs/test_resnet.py @@ -21,3 +21,5 @@ def test_resnet(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_separable_conv_module.py b/tests/test_models/test_archs/test_separable_conv_module.py index 0b9a7259f1..e876ede515 100644 --- a/tests/test_models/test_archs/test_separable_conv_module.py +++ b/tests/test_models/test_archs/test_separable_conv_module.py @@ -75,3 +75,5 @@ def test_depthwise_separable_conv(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_simple_encoder_decoder.py b/tests/test_models/test_archs/test_simple_encoder_decoder.py index fd6a5557d4..b90a6479ef 100644 --- a/tests/test_models/test_archs/test_simple_encoder_decoder.py +++ b/tests/test_models/test_archs/test_simple_encoder_decoder.py @@ -92,3 +92,5 @@ def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_smpatch_disc.py b/tests/test_models/test_archs/test_smpatch_disc.py index 8449e52771..c66acd5de2 100644 --- a/tests/test_models/test_archs/test_smpatch_disc.py +++ b/tests/test_models/test_archs/test_smpatch_disc.py @@ -50,3 +50,5 @@ def test_smpatch_discriminator(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_sr_backbone.py b/tests/test_models/test_archs/test_sr_backbone.py index 0b68cfc1d7..2e57235213 100644 --- a/tests/test_models/test_archs/test_sr_backbone.py +++ b/tests/test_models/test_archs/test_sr_backbone.py @@ -15,3 +15,5 @@ def test_sr_backbone_utils(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_tokenizer.py b/tests/test_models/test_archs/test_tokenizer.py index f3096aede2..f9d5e2367e 100644 --- a/tests/test_models/test_archs/test_tokenizer.py +++ b/tests/test_models/test_archs/test_tokenizer.py @@ -51,3 +51,5 @@ def test_encode_and_decode_and_call(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_upsample.py b/tests/test_models/test_archs/test_upsample.py index 34aea00cf0..cb202f582c 100644 --- a/tests/test_models/test_archs/test_upsample.py +++ b/tests/test_models/test_archs/test_upsample.py @@ -24,3 +24,5 @@ def test_pixel_shuffle(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_vgg.py b/tests/test_models/test_archs/test_vgg.py index a271d34be6..2965665f21 100644 --- a/tests/test_models/test_archs/test_vgg.py +++ b/tests/test_models/test_archs/test_vgg.py @@ -134,3 +134,5 @@ def test_vgg16_encoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_archs/test_wrapper.py b/tests/test_models/test_archs/test_wrapper.py index c5f2626fa7..c1b2ae8f70 100644 --- a/tests/test_models/test_archs/test_wrapper.py +++ b/tests/test_models/test_archs/test_wrapper.py @@ -114,3 +114,5 @@ def test_build(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_average_model.py b/tests/test_models/test_base_models/test_average_model.py index 289a391af1..bc5cb170ab 100644 --- a/tests/test_models/test_base_models/test_average_model.py +++ b/tests/test_models/test_base_models/test_average_model.py @@ -222,3 +222,5 @@ def test_load_from_state_dict(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_base_conditional_gan.py b/tests/test_models/test_base_models/test_base_conditional_gan.py index 7394ecde12..126325d323 100644 --- a/tests/test_models/test_base_models/test_base_conditional_gan.py +++ b/tests/test_models/test_base_models/test_base_conditional_gan.py @@ -292,3 +292,5 @@ def test_custom_loss(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_base_edit_model.py b/tests/test_models/test_base_models/test_base_edit_model.py index c9ea0469aa..7b85a49fab 100644 --- a/tests/test_models/test_base_models/test_base_edit_model.py +++ b/tests/test_models/test_base_models/test_base_edit_model.py @@ -69,3 +69,5 @@ def test_base_edit_model(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_base_gan.py b/tests/test_models/test_base_models/test_base_gan.py index 7d612d0925..4d69d937ad 100644 --- a/tests/test_models/test_base_models/test_base_gan.py +++ b/tests/test_models/test_base_models/test_base_gan.py @@ -432,3 +432,5 @@ def test_gather_log_vars(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_base_mattor.py b/tests/test_models/test_base_models/test_base_mattor.py index db4ffa3ccc..f5ab38f4a4 100644 --- a/tests/test_models/test_base_models/test_base_mattor.py +++ b/tests/test_models/test_base_models/test_base_mattor.py @@ -466,3 +466,5 @@ def test_gca(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_base_translation_model.py b/tests/test_models/test_base_models/test_base_translation_model.py index f773f8e769..e9821565ed 100644 --- a/tests/test_models/test_base_models/test_base_translation_model.py +++ b/tests/test_models/test_base_models/test_base_translation_model.py @@ -75,3 +75,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_basic_interpolator.py b/tests/test_models/test_base_models/test_basic_interpolator.py index 1c04427b53..9e119b16db 100644 --- a/tests/test_models/test_base_models/test_basic_interpolator.py +++ b/tests/test_models/test_base_models/test_basic_interpolator.py @@ -44,3 +44,5 @@ def test_basic_interpolator(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_one_stage.py b/tests/test_models/test_base_models/test_one_stage.py index fd662e9bee..b87bd4922a 100644 --- a/tests/test_models/test_base_models/test_one_stage.py +++ b/tests/test_models/test_base_models/test_one_stage.py @@ -106,3 +106,5 @@ def test_one_stage_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_base_models/test_two_stage.py b/tests/test_models/test_base_models/test_two_stage.py index f431b33f12..72efb60701 100644 --- a/tests/test_models/test_base_models/test_two_stage.py +++ b/tests/test_models/test_base_models/test_two_stage.py @@ -114,3 +114,5 @@ def test_two_stage_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_data_preprocessors/test_data_preprocessor.py b/tests/test_models/test_data_preprocessors/test_data_preprocessor.py index c40b413b20..60d7dd20d9 100644 --- a/tests/test_models/test_data_preprocessors/test_data_preprocessor.py +++ b/tests/test_models/test_data_preprocessors/test_data_preprocessor.py @@ -881,3 +881,5 @@ def test_destruct(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py b/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py index 561ac842f0..1d7a927001 100644 --- a/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py +++ b/tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py @@ -59,3 +59,5 @@ def test_mattor_preprocessor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py b/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py index b490aca185..037a93239e 100644 --- a/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py +++ b/tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py @@ -55,3 +55,5 @@ def test_ddim_step(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_diffusion_schedulers/test_init.py b/tests/test_models/test_diffusion_schedulers/test_init.py index 548ec5e263..42269091c4 100644 --- a/tests/test_models/test_diffusion_schedulers/test_init.py +++ b/tests/test_models/test_diffusion_schedulers/test_init.py @@ -51,3 +51,5 @@ def test_build(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py index 8cf924a915..28738c1928 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_decoder.py @@ -21,3 +21,5 @@ def test_gl_dec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py index 351f965ffc..3a7fa1d750 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_encoder.py @@ -21,3 +21,5 @@ def test_gl_enc(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py b/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py index 565f843119..55c46ab763 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py @@ -39,3 +39,5 @@ def test_gl_encdec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py b/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py index ffa1fc7964..c7b1e1a414 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py @@ -79,3 +79,5 @@ def test_aot_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_aotgan/test_aot_neck.py b/tests/test_models/test_editors/test_aotgan/test_aot_neck.py index df7a702f36..6488071601 100644 --- a/tests/test_models/test_editors/test_aotgan/test_aot_neck.py +++ b/tests/test_models/test_editors/test_aotgan/test_aot_neck.py @@ -23,3 +23,5 @@ def test_aot_dilation_neck(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_arcface/test_arcface_modules.py b/tests/test_models/test_editors/test_arcface/test_arcface_modules.py index 7c180e90d6..fc3e78b7ad 100644 --- a/tests/test_models/test_editors/test_arcface/test_arcface_modules.py +++ b/tests/test_models/test_editors/test_arcface/test_arcface_modules.py @@ -24,3 +24,5 @@ def test_get_blocks(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_arcface/test_id_loss.py b/tests/test_models/test_editors/test_arcface/test_id_loss.py index 3a9e8f94d8..f8f2ff3c48 100644 --- a/tests/test_models/test_editors/test_arcface/test_id_loss.py +++ b/tests/test_models/test_editors/test_arcface/test_id_loss.py @@ -42,3 +42,5 @@ def test_arcface_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_arcface/test_model_irse.py b/tests/test_models/test_editors/test_arcface/test_model_irse.py index 90c4215304..01711f487a 100644 --- a/tests/test_models/test_editors/test_arcface/test_model_irse.py +++ b/tests/test_models/test_editors/test_arcface/test_model_irse.py @@ -119,3 +119,5 @@ def test_arcface_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py b/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py index 8c1ea4a0b6..50757dc9eb 100644 --- a/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py +++ b/tests/test_models/test_editors/test_basicvsr/test_basicvsr.py @@ -84,3 +84,5 @@ def test_basicvsr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py b/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py index aa85958ad4..96895d22f6 100644 --- a/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py +++ b/tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py @@ -32,3 +32,5 @@ def test_basicvsr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py b/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py index 6e1d31b79a..f9815e4c85 100644 --- a/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py +++ b/tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py @@ -97,3 +97,5 @@ def test_basicvsr_plusplus_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan.py b/tests/test_models/test_editors/test_biggan/test_biggan.py index 4c7058b02a..6972accc62 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan.py @@ -137,3 +137,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py b/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py index f6eaaad776..41ddb26f12 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py @@ -108,3 +108,5 @@ def test_biggan_deep_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py b/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py index 6319d15704..6430443a2e 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py @@ -233,3 +233,5 @@ def test_biggan_deep_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py b/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py index 28323893ea..b83e9141ec 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py @@ -125,3 +125,5 @@ def test_biggan_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_generator.py b/tests/test_models/test_editors/test_biggan/test_biggan_generator.py index 9241c32c50..dc187b1fd7 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_generator.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_generator.py @@ -237,3 +237,5 @@ def test_biggan_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_modules.py b/tests/test_models/test_editors/test_biggan/test_biggan_modules.py index 687db7f4b7..5aacf84ca4 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_modules.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_modules.py @@ -439,3 +439,5 @@ def test_biggan_disc_res_block_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py b/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py index 776bb4fd60..146c210267 100644 --- a/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py +++ b/tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py @@ -37,3 +37,5 @@ def test_SpectralNorm(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_cain/test_cain.py b/tests/test_models/test_editors/test_cain/test_cain.py index 43ebc9a217..327e53d6b3 100644 --- a/tests/test_models/test_editors/test_cain/test_cain.py +++ b/tests/test_models/test_editors/test_cain/test_cain.py @@ -131,3 +131,5 @@ def test_cain(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_cain/test_cain_net.py b/tests/test_models/test_editors/test_cain/test_cain_net.py index 3149034bca..579c251ac4 100644 --- a/tests/test_models/test_editors/test_cain/test_cain_net.py +++ b/tests/test_models/test_editors/test_cain/test_cain_net.py @@ -86,3 +86,5 @@ def test_cain_net_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_controlnet/test_controlnet.py b/tests/test_models/test_editors/test_controlnet/test_controlnet.py index 9d9ba7baf7..a93160a759 100644 --- a/tests/test_models/test_editors/test_controlnet/test_controlnet.py +++ b/tests/test_models/test_editors/test_controlnet/test_controlnet.py @@ -229,3 +229,5 @@ def forward(self, *args, **kwargs): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py b/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py index a8cafe5339..ade9b7d71e 100644 --- a/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py +++ b/tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py @@ -72,3 +72,5 @@ def test_change_base_model(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py index 3c83a34c49..1a51cb312b 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan.py @@ -335,3 +335,5 @@ def test_cyclegan(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py index 093a4e3c57..cfd5ac1ee6 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py @@ -58,3 +58,5 @@ def test_cyclegan_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py index 479b1db2be..bbeb267180 100644 --- a/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py +++ b/tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py @@ -79,3 +79,5 @@ def test_gan_image_buffer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan.py b/tests/test_models/test_editors/test_dcgan/test_dcgan.py index 4aaee972dd..425ad43c9b 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan.py @@ -100,3 +100,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py b/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py index 123c94324c..7f0fd2b308 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py @@ -60,3 +60,5 @@ def test_dcgan_discriminator(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py b/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py index b0587bd31f..e23f55ec68 100644 --- a/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py +++ b/tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py @@ -100,3 +100,5 @@ def test_dcgan_generator(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_attention.py b/tests/test_models/test_editors/test_ddpm/test_attention.py index 892ac376de..f18ded7427 100644 --- a/tests/test_models/test_editors/test_ddpm/test_attention.py +++ b/tests/test_models/test_editors/test_ddpm/test_attention.py @@ -42,3 +42,5 @@ def test_FeedForward(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py b/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py index 041d68abed..30264bf0a0 100644 --- a/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py +++ b/tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py @@ -45,3 +45,5 @@ def test_ddpm_init(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py b/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py index a387c62380..0b0e19dfec 100644 --- a/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py +++ b/tests/test_models/test_editors/test_ddpm/test_denoising_unet.py @@ -23,3 +23,5 @@ def test_NormWithEmbedding(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_embeddings.py b/tests/test_models/test_editors/test_ddpm/test_embeddings.py index 71945114a8..819eafa7d6 100644 --- a/tests/test_models/test_editors/test_ddpm/test_embeddings.py +++ b/tests/test_models/test_editors/test_ddpm/test_embeddings.py @@ -28,3 +28,5 @@ def test_Timesteps(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_res_blocks.py b/tests/test_models/test_editors/test_ddpm/test_res_blocks.py index b3ce33c414..89bd8b2948 100644 --- a/tests/test_models/test_editors/test_ddpm/test_res_blocks.py +++ b/tests/test_models/test_editors/test_ddpm/test_res_blocks.py @@ -37,3 +37,5 @@ def test_Upsample2D(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py b/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py index 14927788ec..f4c9d0d86f 100644 --- a/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py +++ b/tests/test_models/test_editors/test_ddpm/test_unet_blocks.py @@ -49,3 +49,5 @@ def get_get_up_block(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py index 07fe2ee558..a534386865 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py @@ -129,3 +129,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py index 4668c42cd3..15ffd3f348 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py @@ -61,3 +61,5 @@ def test_deblurganv2_discriminator(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py index 1aae9cbc7b..2ae7fcb820 100644 --- a/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py +++ b/tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py @@ -69,3 +69,5 @@ def test_deblurganv2_generator(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py index cadf1f0a38..787b05d88f 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py @@ -17,3 +17,5 @@ def test_deepfill_contextual_attention_module(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py index 4e39ec7dff..74018ce1a7 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py @@ -35,3 +35,5 @@ def test_deepfill_contextual_attention_neck(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py index 97777abfc2..d8a44d70b2 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py @@ -45,3 +45,5 @@ def test_deepfill_dec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py index 5554aa4950..2ee7afcf1d 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py @@ -54,3 +54,5 @@ def test_deepfillv1_disc(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py index e2a1510890..6cb00f0645 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py @@ -86,3 +86,5 @@ def test_deepfill_enc(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py index 873138c253..0974fd03f9 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py @@ -44,3 +44,5 @@ def test_deepfill_refiner(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py b/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py index 4848c4e985..d8def6dbec 100644 --- a/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py +++ b/tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py @@ -104,3 +104,5 @@ def test_deepfillv1_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py b/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py index ae4f064c56..0d793907f2 100644 --- a/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py +++ b/tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py @@ -110,3 +110,5 @@ def test_two_stage_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dic/test_dic.py b/tests/test_models/test_editors/test_dic/test_dic.py index 1bc34a8675..72994efc28 100644 --- a/tests/test_models/test_editors/test_dic/test_dic.py +++ b/tests/test_models/test_editors/test_dic/test_dic.py @@ -84,3 +84,5 @@ def test_dic(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dic/test_dic_net.py b/tests/test_models/test_editors/test_dic/test_dic_net.py index 1813f107e5..3377ffaa9d 100644 --- a/tests/test_models/test_editors/test_dic/test_dic_net.py +++ b/tests/test_models/test_editors/test_dic/test_dic_net.py @@ -129,3 +129,5 @@ def test_dic_net_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py b/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py index 27c30327f3..122c22cf5d 100644 --- a/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py +++ b/tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py @@ -70,3 +70,5 @@ def test_reduce_to_five_heatmaps(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dic/test_light_cnn.py b/tests/test_models/test_editors/test_dic/test_light_cnn.py index 0d82fdddd2..b619c19f23 100644 --- a/tests/test_models/test_editors/test_dic/test_light_cnn.py +++ b/tests/test_models/test_editors/test_dic/test_light_cnn.py @@ -56,3 +56,5 @@ def test_light_cnn(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dim/test_dim.py b/tests/test_models/test_editors/test_dim/test_dim.py index f414cbe3b9..0bdecedf94 100644 --- a/tests/test_models/test_editors/test_dim/test_dim.py +++ b/tests/test_models/test_editors/test_dim/test_dim.py @@ -289,3 +289,5 @@ def test_dim(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py index 172c10dea8..cc32ca95e9 100644 --- a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py +++ b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py @@ -251,3 +251,5 @@ def forward(self, x): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py index 28708c5d31..18b4a37d11 100644 --- a/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py +++ b/tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py @@ -120,3 +120,5 @@ def test_embedding_layer_with_fixes(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py b/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py index 9f0d4ec386..ae7d035389 100644 --- a/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py +++ b/tests/test_models/test_editors/test_dreambooth/test_dreambooth.py @@ -150,3 +150,5 @@ def forward(self, *args, **kwargs): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_duf/test_duf.py b/tests/test_models/test_editors/test_duf/test_duf.py index 77ef2da7a4..e3746e8243 100644 --- a/tests/test_models/test_editors/test_duf/test_duf.py +++ b/tests/test_models/test_editors/test_duf/test_duf.py @@ -38,3 +38,5 @@ def test_dynamic_upsampling_filter(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_edsr/test_edsr_net.py b/tests/test_models/test_editors/test_edsr/test_edsr_net.py index 90685c1108..8dbf3aa01e 100644 --- a/tests/test_models/test_editors/test_edsr/test_edsr_net.py +++ b/tests/test_models/test_editors/test_edsr/test_edsr_net.py @@ -88,3 +88,5 @@ def test_edsr_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_edvr/test_edvr.py b/tests/test_models/test_editors/test_edvr/test_edvr.py index 7ebb6fbb82..1a1cd3f3b7 100644 --- a/tests/test_models/test_editors/test_edvr/test_edvr.py +++ b/tests/test_models/test_editors/test_edvr/test_edvr.py @@ -75,3 +75,5 @@ def test_edvr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_edvr/test_edvr_net.py b/tests/test_models/test_editors/test_edvr/test_edvr_net.py index 5b8e352dcf..5ee9ab556f 100644 --- a/tests/test_models/test_editors/test_edvr/test_edvr_net.py +++ b/tests/test_models/test_editors/test_edvr/test_edvr_net.py @@ -138,3 +138,5 @@ def test_edvr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_camera.py b/tests/test_models/test_editors/test_eg3d/test_camera.py index dd4644144b..79311d2107 100644 --- a/tests/test_models/test_editors/test_eg3d/test_camera.py +++ b/tests/test_models/test_editors/test_eg3d/test_camera.py @@ -177,3 +177,5 @@ def test_repr(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py b/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py index 38c40e782e..361fdc284c 100644 --- a/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py +++ b/tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py @@ -89,3 +89,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d.py b/tests/test_models/test_editors/test_eg3d/test_eg3d.py index e2404abdd1..406669b099 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d.py @@ -173,3 +173,5 @@ def test_interpolation(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py index daaa896cab..4fa4bd73ac 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py @@ -80,3 +80,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py index 9859968a17..367b983639 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py @@ -128,3 +128,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py b/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py index eb196d9bd6..8008cdcb17 100644 --- a/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py +++ b/tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py @@ -37,3 +37,5 @@ def test_inverse_transform_sampling(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py b/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py index ef9daed77a..1c7db80302 100644 --- a/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py +++ b/tests/test_models/test_editors/test_eg3d/test_ray_sampler.py @@ -37,3 +37,5 @@ def test_sample_rays(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_eg3d/test_renderer.py b/tests/test_models/test_editors/test_eg3d/test_renderer.py index 15fa9eec97..d093e97bc0 100644 --- a/tests/test_models/test_editors/test_eg3d/test_renderer.py +++ b/tests/test_models/test_editors/test_eg3d/test_renderer.py @@ -113,3 +113,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_esrgan/test_esrgan.py b/tests/test_models/test_editors/test_esrgan/test_esrgan.py index 42c6e2fc85..3068729c61 100644 --- a/tests/test_models/test_editors/test_esrgan/test_esrgan.py +++ b/tests/test_models/test_editors/test_esrgan/test_esrgan.py @@ -84,3 +84,5 @@ def test_esrgan(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py b/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py index 6cd085c669..77b3c2af86 100644 --- a/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py +++ b/tests/test_models/test_editors/test_esrgan/test_rrdb_net.py @@ -56,3 +56,5 @@ def test_rrdbnet_backbone(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_fba/test_fba_decoder.py b/tests/test_models/test_editors/test_fba/test_fba_decoder.py index 5c3125f896..3d0be205e9 100644 --- a/tests/test_models/test_editors/test_fba/test_fba_decoder.py +++ b/tests/test_models/test_editors/test_fba/test_fba_decoder.py @@ -57,3 +57,5 @@ def test_fba_decoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_fba/test_fba_encoder.py b/tests/test_models/test_editors/test_fba/test_fba_encoder.py index 1593731aee..455f3f9e5d 100644 --- a/tests/test_models/test_editors/test_fba/test_fba_encoder.py +++ b/tests/test_models/test_editors/test_fba/test_fba_encoder.py @@ -138,3 +138,5 @@ def test_fba_encoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_flavr/test_flavr.py b/tests/test_models/test_editors/test_flavr/test_flavr.py index 6bc7ffa854..5cde6778fb 100644 --- a/tests/test_models/test_editors/test_flavr/test_flavr.py +++ b/tests/test_models/test_editors/test_flavr/test_flavr.py @@ -36,3 +36,5 @@ def test_flavr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_flavr/test_flavr_net.py b/tests/test_models/test_editors/test_flavr/test_flavr_net.py index e12d6f482c..a9a2e670b1 100644 --- a/tests/test_models/test_editors/test_flavr/test_flavr_net.py +++ b/tests/test_models/test_editors/test_flavr/test_flavr_net.py @@ -55,3 +55,5 @@ def test_flavr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_gca/test_gca.py b/tests/test_models/test_editors/test_gca/test_gca.py index 8f23b63eb2..77e11c65be 100644 --- a/tests/test_models/test_editors/test_gca/test_gca.py +++ b/tests/test_models/test_editors/test_gca/test_gca.py @@ -184,3 +184,5 @@ def test_gca(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_gca/test_gca_module.py b/tests/test_models/test_editors/test_gca/test_gca_module.py index 497b027214..7645fc238c 100644 --- a/tests/test_models/test_editors/test_gca/test_gca_module.py +++ b/tests/test_models/test_editors/test_gca/test_gca_module.py @@ -136,3 +136,5 @@ def test_gca_module(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_gca/test_resgca_dec.py b/tests/test_models/test_editors/test_gca/test_resgca_dec.py index 08244893ac..3202efe804 100644 --- a/tests/test_models/test_editors/test_gca/test_resgca_dec.py +++ b/tests/test_models/test_editors/test_gca/test_resgca_dec.py @@ -140,3 +140,5 @@ def test_res_gca_decoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_gca/test_resgca_enc.py b/tests/test_models/test_editors/test_gca/test_resgca_enc.py index 64c4a52407..c47731875a 100644 --- a/tests/test_models/test_editors/test_gca/test_resgca_enc.py +++ b/tests/test_models/test_editors/test_gca/test_resgca_enc.py @@ -181,3 +181,5 @@ def test_res_shortcut_encoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ggan/test_ggan.py b/tests/test_models/test_editors/test_ggan/test_ggan.py index 89abd12d86..dc92bbfcb8 100644 --- a/tests/test_models/test_editors/test_ggan/test_ggan.py +++ b/tests/test_models/test_editors/test_ggan/test_ggan.py @@ -100,3 +100,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py b/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py index a89aa8b653..fbce7b8bcd 100644 --- a/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py +++ b/tests/test_models/test_editors/test_glean/test_glean_styleganv2.py @@ -87,3 +87,5 @@ def test_glean(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_glide/test_glide.py b/tests/test_models/test_editors/test_glide/test_glide.py index c193a9b084..20d87c5e19 100644 --- a/tests/test_models/test_editors/test_glide/test_glide.py +++ b/tests/test_models/test_editors/test_glide/test_glide.py @@ -110,3 +110,5 @@ def test_infer(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_decoder.py b/tests/test_models/test_editors/test_global_local/test_gl_decoder.py index 099105fc3a..a9d7bdd601 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_decoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_decoder.py @@ -38,3 +38,5 @@ def test_gl_decoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_dilation.py b/tests/test_models/test_editors/test_global_local/test_gl_dilation.py index 11fde4e9ff..2b2c54ef5e 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_dilation.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_dilation.py @@ -32,3 +32,5 @@ def test_gl_dilation_neck(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_disc.py b/tests/test_models/test_editors/test_global_local/test_gl_disc.py index 9e55ab050d..84daae3198 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_disc.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_disc.py @@ -46,3 +46,5 @@ def test_gl_discs(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_encoder.py b/tests/test_models/test_editors/test_global_local/test_gl_encoder.py index c9db271551..bcace0504d 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_encoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_encoder.py @@ -24,3 +24,5 @@ def test_gl_encoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py b/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py index a481b8c234..4a57b47719 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py @@ -41,3 +41,5 @@ def test_gl_encdec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py b/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py index 8ccab3ff48..f6046f40f5 100644 --- a/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py +++ b/tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py @@ -74,3 +74,5 @@ def test_gl_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_guided_diffusion/test_adm.py b/tests/test_models/test_editors/test_guided_diffusion/test_adm.py index 58e131169c..a4f6a1815c 100644 --- a/tests/test_models/test_editors/test_guided_diffusion/test_adm.py +++ b/tests/test_models/test_editors/test_guided_diffusion/test_adm.py @@ -92,3 +92,5 @@ def test_infer(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py b/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py index c40405be4b..42d9b5ae8d 100644 --- a/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py +++ b/tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py @@ -85,3 +85,5 @@ def test_iconvsr(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet.py b/tests/test_models/test_editors/test_indexnet/test_indexnet.py index 3c7df55de8..8f6bfdd505 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet.py @@ -214,3 +214,5 @@ def test_indexed_upsample(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py b/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py index e0fb0c273d..a586cdc633 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py @@ -38,3 +38,5 @@ def test_indexnet_decoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py b/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py index 330ede1e46..3232703f50 100644 --- a/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py +++ b/tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py @@ -144,3 +144,5 @@ def test_index_blocks(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py b/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py index 401dd87f97..a74062a9a4 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_color_utils.py @@ -156,3 +156,5 @@ def test_encode_ab_ind(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py b/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py index e213cb76b2..5ddeeb139e 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py @@ -45,3 +45,5 @@ def test_colorization_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py b/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py index 92906a1384..834cd601cf 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py @@ -84,3 +84,5 @@ def test_fusion_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py b/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py index 6ac917779d..15a5957d03 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py @@ -126,3 +126,5 @@ def test_inst_colorization(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py b/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py index a3c4b50e61..70ee9342a0 100644 --- a/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py +++ b/tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py @@ -33,3 +33,5 @@ def test_weight_layer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_liif/test_liif.py b/tests/test_models/test_editors/test_liif/test_liif.py index 357d3f95ad..1fca44282c 100644 --- a/tests/test_models/test_editors/test_liif/test_liif.py +++ b/tests/test_models/test_editors/test_liif/test_liif.py @@ -76,3 +76,5 @@ def test_liif(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_liif/test_liif_net.py b/tests/test_models/test_editors/test_liif/test_liif_net.py index d93a221af4..4bf5595f90 100644 --- a/tests/test_models/test_editors/test_liif/test_liif_net.py +++ b/tests/test_models/test_editors/test_liif/test_liif_net.py @@ -118,3 +118,5 @@ def test_liif_rdn_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_liif/test_mlp_refiner.py b/tests/test_models/test_editors/test_liif/test_mlp_refiner.py index abc7fe0153..f441129533 100644 --- a/tests/test_models/test_editors/test_liif/test_mlp_refiner.py +++ b/tests/test_models/test_editors/test_liif/test_mlp_refiner.py @@ -14,3 +14,5 @@ def test_MLPRefiner(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan.py b/tests/test_models/test_editors/test_lsgan/test_lsgan.py index 152737b892..a6eed582ed 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan.py @@ -100,3 +100,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py b/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py index 15bb627845..4ced446509 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py @@ -75,3 +75,5 @@ def test_lsgan_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py b/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py index 1e332864fa..153a0313e4 100644 --- a/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py +++ b/tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py @@ -61,3 +61,5 @@ def test_lsgan_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py index 7abcdd09e0..2c33300dfa 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py @@ -75,3 +75,5 @@ def test_stylegan2_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py index 144c0115d4..234d4dd78d 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py @@ -40,3 +40,5 @@ def test_msstylegan2_disc_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py index 5ccad9ed90..2592d117e6 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py @@ -138,3 +138,5 @@ def test_head_pos_encoding(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py index d8d8dbca0c..d98e6c9704 100644 --- a/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py +++ b/tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py @@ -113,3 +113,5 @@ def test_up_after_conv(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_pe_singan.py b/tests/test_models/test_editors/test_mspie/test_pe_singan.py index f7c2726c1c..206b9227e1 100644 --- a/tests/test_models/test_editors/test_mspie/test_pe_singan.py +++ b/tests/test_models/test_editors/test_mspie/test_pe_singan.py @@ -123,3 +123,5 @@ def test_pesingan_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py b/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py index 6ef6df28d3..98b32a60f2 100644 --- a/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py +++ b/tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py @@ -98,3 +98,5 @@ def test_singan_gen_pe(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_mspie/test_positional_encoding.py b/tests/test_models/test_editors/test_mspie/test_positional_encoding.py index 08d9afa4b3..20c43cc5c0 100644 --- a/tests/test_models/test_editors/test_mspie/test_positional_encoding.py +++ b/tests/test_models/test_editors/test_mspie/test_positional_encoding.py @@ -62,3 +62,5 @@ def test_csg_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py b/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py index d06de750a7..6c217b4983 100644 --- a/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py +++ b/tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py @@ -56,3 +56,5 @@ def test_avgpool2d(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py b/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py index 9641c975e1..2aab3d9285 100644 --- a/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py +++ b/tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py @@ -17,3 +17,5 @@ def test_layer_norm(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py b/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py index 7c06f26df4..81a160e18e 100644 --- a/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py +++ b/tests/test_models/test_editors/test_nafnet/test_nafbaseline.py @@ -71,3 +71,5 @@ def test_baseline_local(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_nafnet/test_nafnet.py b/tests/test_models/test_editors/test_nafnet/test_nafnet.py index a8a05b49c8..7b501d81a4 100644 --- a/tests/test_models/test_editors/test_nafnet/test_nafnet.py +++ b/tests/test_models/test_editors/test_nafnet/test_nafnet.py @@ -71,3 +71,5 @@ def test_nafnet_local(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py b/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py index 95c741e3af..77a7338239 100644 --- a/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py +++ b/tests/test_models/test_editors/test_pconv/test_mask_conv_module.py @@ -81,3 +81,5 @@ def test_mask_conv_module(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_partial_conv.py b/tests/test_models/test_editors/test_pconv/test_partial_conv.py index 347bb2f0aa..682c908e91 100644 --- a/tests/test_models/test_editors/test_pconv/test_partial_conv.py +++ b/tests/test_models/test_editors/test_pconv/test_partial_conv.py @@ -76,3 +76,5 @@ def test_pconv2d(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py index b228e444b4..55e24bbbb0 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_decoder.py @@ -26,3 +26,5 @@ def test_pconv_dec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py index bd2bb4575e..05dc00bec6 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_encoder.py @@ -30,3 +30,5 @@ def test_pconv_enc(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py b/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py index 14586d6efc..7fb5bacd22 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py @@ -27,3 +27,5 @@ def test_pconv_encdec(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py b/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py index 981430a217..bcd270bd32 100644 --- a/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py +++ b/tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py @@ -67,3 +67,5 @@ def test_pconv_inpaintor(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan.py b/tests/test_models/test_editors/test_pggan/test_pggan.py index 49a7f24bbc..92ac04096a 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan.py @@ -189,3 +189,5 @@ def test_pggan_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py b/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py index d2b9451c41..54cbed71db 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py @@ -77,3 +77,5 @@ def test_pggan_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_generator.py b/tests/test_models/test_editors/test_pggan/test_pggan_generator.py index 2350811aae..053c77a0bf 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_generator.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_generator.py @@ -75,3 +75,5 @@ def test_pggan_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pggan/test_pggan_modules.py b/tests/test_models/test_editors/test_pggan/test_pggan_modules.py index a8190b4706..cea16e4af6 100644 --- a/tests/test_models/test_editors/test_pggan/test_pggan_modules.py +++ b/tests/test_models/test_editors/test_pggan/test_pggan_modules.py @@ -338,3 +338,5 @@ def test_pggan_noise2feat_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py index 441f11102e..d652ea3504 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix.py @@ -255,3 +255,5 @@ def test_pix2pix_val_step(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py index f671be26b6..bab85cf187 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py @@ -65,3 +65,5 @@ def test_pix2pix_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py index 125b56d9c2..b443d2a552 100644 --- a/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py +++ b/tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py @@ -15,3 +15,5 @@ def test_unet_skip_connection_block(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_plain/test_plain_decoder.py b/tests/test_models/test_editors/test_plain/test_plain_decoder.py index de55391078..5467a08267 100644 --- a/tests/test_models/test_editors/test_plain/test_plain_decoder.py +++ b/tests/test_models/test_editors/test_plain/test_plain_decoder.py @@ -62,3 +62,5 @@ def test_plain_decoder(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_plain/test_plain_refiner.py b/tests/test_models/test_editors/test_plain/test_plain_refiner.py index 467350d20a..a5ea558c68 100644 --- a/tests/test_models/test_editors/test_plain/test_plain_refiner.py +++ b/tests/test_models/test_editors/test_plain/test_plain_refiner.py @@ -23,3 +23,5 @@ def test_plain_refiner(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_rdn/test_rdn_net.py b/tests/test_models/test_editors/test_rdn/test_rdn_net.py index f76819f8fb..67a76820d8 100644 --- a/tests/test_models/test_editors/test_rdn/test_rdn_net.py +++ b/tests/test_models/test_editors/test_rdn/test_rdn_net.py @@ -63,3 +63,5 @@ def test_rdn(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py index f0e72b60c0..a06f20fd3f 100644 --- a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py +++ b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py @@ -117,3 +117,5 @@ def test_real_basicvsr(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py index 83e9c2bbde..53ab5b27ca 100644 --- a/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py +++ b/tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py @@ -54,3 +54,5 @@ def test_real_basicvsr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py b/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py index 37d548589c..aa9230115d 100644 --- a/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py +++ b/tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py @@ -115,3 +115,5 @@ def test_real_esrgan(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py b/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py index bc76ee2d64..ba711cee52 100644 --- a/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py +++ b/tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py @@ -28,3 +28,5 @@ def test_unet_disc_with_spectral_norm(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_restormer/test_restormer_net.py b/tests/test_models/test_editors/test_restormer/test_restormer_net.py index 98633e008a..2d1c27d9d4 100644 --- a/tests/test_models/test_editors/test_restormer/test_restormer_net.py +++ b/tests/test_models/test_editors/test_restormer/test_restormer_net.py @@ -111,3 +111,5 @@ def test_restormer_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan.py b/tests/test_models/test_editors/test_sagan/test_sagan.py index 36864bba56..f12975cb98 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan.py @@ -133,3 +133,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py b/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py index b6925bdfa8..3cf9001eb2 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py @@ -280,3 +280,5 @@ def test_sngan_proj_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_generator.py b/tests/test_models/test_editors/test_sagan/test_sagan_generator.py index d12b5c0556..76f45fef6f 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_generator.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_generator.py @@ -305,3 +305,5 @@ def test_sngan_proj_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_sagan/test_sagan_modules.py b/tests/test_models/test_editors/test_sagan/test_sagan_modules.py index 37ce9d21ed..d98a679698 100644 --- a/tests/test_models/test_editors/test_sagan/test_sagan_modules.py +++ b/tests/test_models/test_editors/test_sagan/test_sagan_modules.py @@ -509,3 +509,5 @@ def test_conditionalNorm_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_singan/test_singan.py b/tests/test_models/test_editors/test_singan/test_singan.py index 2a6ff52ea9..d88ff99053 100644 --- a/tests/test_models/test_editors/test_singan/test_singan.py +++ b/tests/test_models/test_editors/test_singan/test_singan.py @@ -130,3 +130,5 @@ def test_singan_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_singan/test_singan_discriminator.py b/tests/test_models/test_editors/test_singan/test_singan_discriminator.py index 24a207c509..aa051dbedf 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_discriminator.py +++ b/tests/test_models/test_editors/test_singan/test_singan_discriminator.py @@ -27,3 +27,5 @@ def test_singan_disc(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_singan/test_singan_generator.py b/tests/test_models/test_editors/test_singan/test_singan_generator.py index cd6e7ca069..6f0b5ee853 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_generator.py +++ b/tests/test_models/test_editors/test_singan/test_singan_generator.py @@ -47,3 +47,5 @@ def test_singan_gen(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_singan/test_singan_modules.py b/tests/test_models/test_editors/test_singan/test_singan_modules.py index a5d11c9163..fa1e6c4a94 100644 --- a/tests/test_models/test_editors/test_singan/test_singan_modules.py +++ b/tests/test_models/test_editors/test_singan/test_singan_modules.py @@ -29,3 +29,5 @@ def test_DiscriminatorBlock(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py b/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py index d7fb548a07..6dea078a01 100644 --- a/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py +++ b/tests/test_models/test_editors/test_srcnn/test_srcnn_net.py @@ -41,3 +41,5 @@ def test_srcnn(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_srgan/test_modified_vgg.py b/tests/test_models/test_editors/test_srgan/test_modified_vgg.py index be8020b521..8fb3eb1834 100644 --- a/tests/test_models/test_editors/test_srgan/test_modified_vgg.py +++ b/tests/test_models/test_editors/test_srgan/test_modified_vgg.py @@ -14,3 +14,5 @@ def test_modifiedVGG(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_srgan/test_sr_resnet.py b/tests/test_models/test_editors/test_srgan/test_sr_resnet.py index 5117d691a8..20d4b84b49 100644 --- a/tests/test_models/test_editors/test_srgan/test_sr_resnet.py +++ b/tests/test_models/test_editors/test_srgan/test_sr_resnet.py @@ -78,3 +78,5 @@ def test_discriminator(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_srgan/test_srgan.py b/tests/test_models/test_editors/test_srgan/test_srgan.py index 2437db233a..c27cbcb70b 100644 --- a/tests/test_models/test_editors/test_srgan/test_srgan.py +++ b/tests/test_models/test_editors/test_srgan/test_srgan.py @@ -83,3 +83,5 @@ def test_srgan_resnet(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py b/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py index 12680a326e..9070821469 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py @@ -56,3 +56,5 @@ def test_load_clip_submodels_transformers_none(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py index 79010d7131..9b1fc08018 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py @@ -126,3 +126,5 @@ def test_stable_diffusion(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py index 42adb5b10b..10f219f50f 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py @@ -140,3 +140,5 @@ class DummyConfig: def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py index 0b94f04c30..02a1c50040 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py @@ -131,3 +131,5 @@ def test_stable_diffusion(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stable_diffusion/test_vae.py b/tests/test_models/test_editors/test_stable_diffusion/test_vae.py index fb3cff952f..172aecf7bc 100644 --- a/tests/test_models/test_editors/test_stable_diffusion/test_vae.py +++ b/tests/test_models/test_editors/test_stable_diffusion/test_vae.py @@ -69,3 +69,5 @@ def test_Upsample2D(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py index 00dbe563e0..28eed6e2d8 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1.py @@ -199,3 +199,5 @@ def test_stylegan_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py index b9de1f1650..da8ec3240e 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py @@ -36,3 +36,5 @@ def test_stylegan1_disc_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py index 4b899bbb3c..b6d5492209 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py @@ -170,3 +170,5 @@ def test_g_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py index 45ba9281d5..39f6eb527b 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py @@ -52,3 +52,5 @@ def test_styleconv_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py b/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py index 0812d869b7..5a91ae9443 100644 --- a/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py +++ b/tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py @@ -35,3 +35,5 @@ def test_style_mixing(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py b/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py index 51464ee316..5ce5a7e8da 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py +++ b/tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py @@ -74,3 +74,5 @@ def test_forward(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py index 13d15a6236..1082f7f191 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2.py @@ -72,3 +72,5 @@ def test_stylegan2_cpu(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py index 2289d600c3..00255e8c1e 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py @@ -116,3 +116,5 @@ def test_ada_pipeline(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py index a4a14b1854..9200eec3af 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py @@ -250,3 +250,5 @@ def test_g_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py index 30eda8286a..b790a84653 100644 --- a/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py +++ b/tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py @@ -263,3 +263,5 @@ def test_torgb_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py index d7436aa27c..9e31c62acf 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3.py @@ -98,3 +98,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py index b68ad7cc0e..d1dc1e05ae 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py @@ -119,3 +119,5 @@ def test_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py index 41df3676c3..30ca0788ad 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py @@ -53,3 +53,5 @@ def test_MappingNetwork(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py index 9d626f98f5..bd38e0bc51 100644 --- a/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py +++ b/tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py @@ -76,3 +76,5 @@ def test_fractional_pseduo_rotation(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_modules.py b/tests/test_models/test_editors/test_swinir/test_swinir_modules.py index 24e9e6accb..5f68ae4ae6 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_modules.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_modules.py @@ -87,3 +87,5 @@ def test_upsampleOneStep(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_net.py b/tests/test_models/test_editors/test_swinir/test_swinir_net.py index ac18e0d9ad..a2c28b1084 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_net.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_net.py @@ -111,3 +111,5 @@ def test_swinir_cuda(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py b/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py index 8ee91e1b9a..4d442c6133 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_rstb.py @@ -28,3 +28,5 @@ def test_rstb(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_swinir/test_swinir_utils.py b/tests/test_models/test_editors/test_swinir/test_swinir_utils.py index 0238c5912b..d68eb691f0 100644 --- a/tests/test_models/test_editors/test_swinir/test_swinir_utils.py +++ b/tests/test_models/test_editors/test_swinir/test_swinir_utils.py @@ -29,3 +29,5 @@ def test_window(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_tdan/test_tdan.py b/tests/test_models/test_editors/test_tdan/test_tdan.py index 1a7848a89c..4dba1627cd 100644 --- a/tests/test_models/test_editors/test_tdan/test_tdan.py +++ b/tests/test_models/test_editors/test_tdan/test_tdan.py @@ -47,3 +47,5 @@ def test_tdan(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_tdan/test_tdan_net.py b/tests/test_models/test_editors/test_tdan/test_tdan_net.py index eca59b6a80..bb7793c524 100644 --- a/tests/test_models/test_editors/test_tdan/test_tdan_net.py +++ b/tests/test_models/test_editors/test_tdan/test_tdan_net.py @@ -21,3 +21,5 @@ def test_tdan_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py b/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py index 1d67f491ec..92409ca057 100644 --- a/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py +++ b/tests/test_models/test_editors/test_tof/test_tof_vfi_net.py @@ -31,3 +31,5 @@ def test_tof_vfi_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py b/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py index 2f59220a08..94ba47019f 100644 --- a/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py +++ b/tests/test_models/test_editors/test_tof/test_tof_vsr_net.py @@ -22,3 +22,5 @@ def test_toflow_vsr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ttsr/test_lte.py b/tests/test_models/test_editors/test_ttsr/test_lte.py index c620936f66..8c8e1ee2bb 100644 --- a/tests/test_models/test_editors/test_ttsr/test_lte.py +++ b/tests/test_models/test_editors/test_ttsr/test_lte.py @@ -25,3 +25,5 @@ def test_lte(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ttsr/test_search_transformer.py b/tests/test_models/test_editors/test_ttsr/test_search_transformer.py index 6531fdcee9..732d3a7b59 100644 --- a/tests/test_models/test_editors/test_ttsr/test_search_transformer.py +++ b/tests/test_models/test_editors/test_ttsr/test_search_transformer.py @@ -27,3 +27,5 @@ def test_search_transformer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr.py b/tests/test_models/test_editors/test_ttsr/test_ttsr.py index d909d5ac53..a480469ee3 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr.py @@ -113,3 +113,5 @@ def test_ttsr(init_weights): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py b/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py index 53f682e476..f1eb9f85c7 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py @@ -27,3 +27,5 @@ def test_ttsr_dict(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py b/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py index 58eef6201f..ead51607e7 100644 --- a/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py +++ b/tests/test_models/test_editors/test_ttsr/test_ttsr_net.py @@ -77,3 +77,5 @@ def test_ttsr_net(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py index 3f4514f449..98afd6a363 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py @@ -111,3 +111,5 @@ def test_wgangp_discriminator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py index ff45c12eab..a5c736e304 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py @@ -87,3 +87,5 @@ def test_wgangp_generator_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py index 69e32317e0..2dfaa29f83 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py @@ -106,3 +106,5 @@ def test_train_step(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py index 6098561b2f..5f2b018c5f 100644 --- a/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py +++ b/tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py @@ -29,3 +29,5 @@ def test_WGANNoiseTo2DFeat(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_clip_loss.py b/tests/test_models/test_losses/test_clip_loss.py index 47c7394b6b..43a1bd5747 100644 --- a/tests/test_models/test_losses/test_clip_loss.py +++ b/tests/test_models/test_losses/test_clip_loss.py @@ -29,3 +29,5 @@ def test_clip_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_composition_loss.py b/tests/test_models/test_losses/test_composition_loss.py index a9e2199909..8f4b75325c 100644 --- a/tests/test_models/test_losses/test_composition_loss.py +++ b/tests/test_models/test_losses/test_composition_loss.py @@ -83,3 +83,5 @@ def test_composition_losses(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_face_id_loss.py b/tests/test_models/test_losses/test_face_id_loss.py index 8263a5eade..e54ab18f28 100644 --- a/tests/test_models/test_losses/test_face_id_loss.py +++ b/tests/test_models/test_losses/test_face_id_loss.py @@ -21,3 +21,5 @@ def test_face_id_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_feature_loss.py b/tests/test_models/test_losses/test_feature_loss.py index 82dd060f83..50af0e6dfd 100644 --- a/tests/test_models/test_losses/test_feature_loss.py +++ b/tests/test_models/test_losses/test_feature_loss.py @@ -55,3 +55,5 @@ def test_light_cnn_feature_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_gan_loss.py b/tests/test_models/test_losses/test_gan_loss.py index affb688e40..9b4c10a33a 100644 --- a/tests/test_models/test_losses/test_gan_loss.py +++ b/tests/test_models/test_losses/test_gan_loss.py @@ -120,3 +120,5 @@ def test_gan_losses(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_gradient_loss.py b/tests/test_models/test_losses/test_gradient_loss.py index 31b7eb4a48..f274af519d 100644 --- a/tests/test_models/test_losses/test_gradient_loss.py +++ b/tests/test_models/test_losses/test_gradient_loss.py @@ -57,3 +57,5 @@ def test_disc_shift_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py index bd63933a0b..76bd90eda8 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py @@ -32,3 +32,5 @@ def test_clip_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py index cc8cb642ad..d51138441e 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py @@ -159,3 +159,5 @@ def test_r1_regularizer(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py index 0cef397fce..1f615da3f7 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py @@ -26,3 +26,5 @@ def test_face_id_loss_comps(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py index d5b56379f6..b7f04fe526 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py @@ -81,3 +81,5 @@ def test_gan_losses(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py b/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py index 35a2c48bd9..910c872344 100644 --- a/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py +++ b/tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py @@ -74,3 +74,5 @@ def test_path_regularizer_cuda(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_loss_wrapper.py b/tests/test_models/test_losses/test_loss_wrapper.py index bd2259c61c..69968100fd 100644 --- a/tests/test_models/test_losses/test_loss_wrapper.py +++ b/tests/test_models/test_losses/test_loss_wrapper.py @@ -60,3 +60,5 @@ def test_utils(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_perceptual_loss.py b/tests/test_models/test_losses/test_perceptual_loss.py index 75b90ed837..dea46795a7 100644 --- a/tests/test_models/test_losses/test_perceptual_loss.py +++ b/tests/test_models/test_losses/test_perceptual_loss.py @@ -150,3 +150,5 @@ def test_t_perceptual_loss(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_losses/test_pixelwise_loss.py b/tests/test_models/test_losses/test_pixelwise_loss.py index 70b037f83b..9bbf380b3b 100644 --- a/tests/test_models/test_losses/test_pixelwise_loss.py +++ b/tests/test_models/test_losses/test_pixelwise_loss.py @@ -117,3 +117,5 @@ def test_pixelwise_losses(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_utils/test_bbox_utils.py b/tests/test_models/test_utils/test_bbox_utils.py index 75935db5a4..6f0347ba42 100644 --- a/tests/test_models/test_utils/test_bbox_utils.py +++ b/tests/test_models/test_utils/test_bbox_utils.py @@ -126,3 +126,5 @@ def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_utils/test_flow_warp.py b/tests/test_models/test_utils/test_flow_warp.py index 28e48b21bb..e5c6588a70 100644 --- a/tests/test_models/test_utils/test_flow_warp.py +++ b/tests/test_models/test_utils/test_flow_warp.py @@ -55,3 +55,5 @@ def test_flow_warp(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_utils/test_model_utils.py b/tests/test_models/test_utils/test_model_utils.py index 53da9b2d60..eb84876015 100644 --- a/tests/test_models/test_utils/test_model_utils.py +++ b/tests/test_models/test_utils/test_model_utils.py @@ -128,3 +128,5 @@ def forward(self, *args, **kwargs): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_utils/test_sampling_utils.py b/tests/test_models/test_utils/test_sampling_utils.py index 2d4ff54a53..6ccf7bcc52 100644 --- a/tests/test_models/test_utils/test_sampling_utils.py +++ b/tests/test_models/test_utils/test_sampling_utils.py @@ -69,3 +69,5 @@ def label_function(num_batches): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_models/test_utils/test_tensor_utils.py b/tests/test_models/test_utils/test_tensor_utils.py index c06b3a53ee..abc5ab2d85 100644 --- a/tests/test_models/test_utils/test_tensor_utils.py +++ b/tests/test_models/test_utils/test_tensor_utils.py @@ -28,3 +28,5 @@ def l2_norm(a): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_structures/test_data_sample.py b/tests/test_structures/test_data_sample.py index 81efd568d1..9fea2c548b 100644 --- a/tests/test_structures/test_data_sample.py +++ b/tests/test_structures/test_data_sample.py @@ -290,3 +290,5 @@ def test_len(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_cli.py b/tests/test_utils/test_cli.py index a53a459631..673ef85134 100644 --- a/tests/test_utils/test_cli.py +++ b/tests/test_utils/test_cli.py @@ -12,3 +12,5 @@ def test_modify_args(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_img_utils.py b/tests/test_utils/test_img_utils.py index d084b3cc04..83428ae727 100644 --- a/tests/test_utils/test_img_utils.py +++ b/tests/test_utils/test_img_utils.py @@ -68,3 +68,5 @@ def test_to_numpy(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_io_utils.py b/tests/test_utils/test_io_utils.py index 347b0430ce..9deb39986c 100644 --- a/tests/test_utils/test_io_utils.py +++ b/tests/test_utils/test_io_utils.py @@ -14,3 +14,5 @@ def test_download_from_url(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_logger.py b/tests/test_utils/test_logger.py index ba9d72d50a..83758b7561 100644 --- a/tests/test_utils/test_logger.py +++ b/tests/test_utils/test_logger.py @@ -9,3 +9,5 @@ def test_print_colored_log(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_sampler.py b/tests/test_utils/test_sampler.py index 3fdaa97366..f4ee368912 100644 --- a/tests/test_utils/test_sampler.py +++ b/tests/test_utils/test_sampler.py @@ -74,3 +74,5 @@ def test_val_data_sampler(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_setup_env.py b/tests/test_utils/test_setup_env.py index 767fe5535f..e5b22d6c07 100644 --- a/tests/test_utils/test_setup_env.py +++ b/tests/test_utils/test_setup_env.py @@ -15,3 +15,5 @@ def test_try_import(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_utils/test_trans_utils.py b/tests/test_utils/test_trans_utils.py index 5ea78e77fb..09501b3780 100644 --- a/tests/test_utils/test_trans_utils.py +++ b/tests/test_utils/test_trans_utils.py @@ -397,3 +397,5 @@ def test_irregular_mask(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_visualization/test_concat_visualizer.py b/tests/test_visualization/test_concat_visualizer.py index 5c2c0c0494..dcb1e2b001 100644 --- a/tests/test_visualization/test_concat_visualizer.py +++ b/tests/test_visualization/test_concat_visualizer.py @@ -43,3 +43,5 @@ def test_concatimagevisualizer(): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_visualization/test_vis_backend.py b/tests/test_visualization/test_vis_backend.py index c1e9547e21..b6a28ad9c7 100644 --- a/tests/test_visualization/test_vis_backend.py +++ b/tests/test_visualization/test_vis_backend.py @@ -164,3 +164,5 @@ def test_wandb(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear() diff --git a/tests/test_visualization/test_visualizer.py b/tests/test_visualization/test_visualizer.py index dcd49735bc..4aecba76af 100644 --- a/tests/test_visualization/test_visualizer.py +++ b/tests/test_visualization/test_visualizer.py @@ -90,3 +90,5 @@ def test_add_datasample(self): def teardown_module(): import gc gc.collect() + globals().clear() + locals().clear()