When creating run scripts for custom model runs, it is currently necessary to separate the dataloader into its own file in the same directory as the main execution or model script. The exception can be caused when the dataloader is in the run script, and the input workers cannot pickle the desired input function that is coming from the __main__ module.
A user porting their own model should separate the dataloader into a file separate from the main entrypoint of the training run script. Although not the only option, one example is shown below of an acceptable directory structure.
Copy
Ask AI
$ ls user_directory--> run_model.py (entry script that is used to start the run using "python run_model.py ...")--> dataloader.py (script containing the dataloaders and input functions)