You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
I am trying to save json file using model.to_json() for rrdn model
I have modified the class to input only patch size dense=RRDN(patch_size=patch_size) # model weights are loaded here model=dense.model with open(os.path.join('RRDN_40x40_C4D30G32G032T10x4.json'), 'w') as f: f.write(model.to_json())
While executing the program I get the following error:
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 169, in deepcopy
rv = reductor(4)
TypeError: can't pickle _thread.RLock objects
I referred #107 but still I am unable to solve the issue
The text was updated successfully, but these errors were encountered:
solved by using local variables for lambda functions instead of using class init attributes directly
def _RRDB(self, input_layer, t): x = input_layer beta=self.beta #THIS SOLVED THE ISSUE for d in range(1, self.D + 1): LFF = self._dense_block(x, d, t) LFF_beta = Lambda(lambda x: x * beta)(LFF) #self.beta was used before x = Add(name='LRL_%d_%d' % (t, d))([x, LFF_beta]) x = Lambda(lambda x: x * beta)(x) #self.beta was used before x = Add(name='RRDB_%d_out' % (t))([input_layer, x]) return x
likewise in _pixel_shuffle() replaced self.scale with local variable scale
I am trying to save json file using model.to_json() for rrdn model
I have modified the class to input only patch size
dense=RRDN(patch_size=patch_size) # model weights are loaded here
model=dense.model
with open(os.path.join('RRDN_40x40_C4D30G32G032T10x4.json'), 'w') as f:
f.write(model.to_json())
While executing the program I get the following error:
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/copy.py", line 169, in deepcopy
rv = reductor(4)
TypeError: can't pickle _thread.RLock objects
I referred #107 but still I am unable to solve the issue
The text was updated successfully, but these errors were encountered: