Tag Archives: Twin network

[Solved] Model training Error: _pickle.PicklingError: Can’t pickle

How to Solve Model training Error: _pickle.Picklingerror: can’t pickle

 

1. Problem description

Recently, when learning the target tracking model of siamfc model, it is found that the following problems always occur during model training on window platform:

_pickle.PicklingError: Can’t pickle <class ‘pairwise.GenericDict’>: attribute lookup GenericDict on pairwise failed

See the following figure for details:

2. Solution

The main problem is that the code is written on Linux platform, test.py has no problem in actual operation, but train.py has problem in window platform, the main problem is on Dataloader, so we can modify this part of the code. The main problem lies in the Dataloader, so we can modify this part of the code. Or we can directly train and test the model under Linux with the source code.

The solution to this problem on Window platform is as follows:

Modify the original code from num_workers = 4 to num_workers = 0 and it will work as follows.

after the modification is completed, the operation effect is as follows: