Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem for your Code in FISH-Net/model/pennet4.py #9

Open
dobbleheart opened this issue Nov 16, 2022 · 1 comment
Open

A problem for your Code in FISH-Net/model/pennet4.py #9

dobbleheart opened this issue Nov 16, 2022 · 1 comment

Comments

@dobbleheart
Copy link

Line24 and line 30 ,why are there two def ?
24------> def init_weights(self, init_type='normal', gain=0.02):
'''
initialize network's weights
init_type: normal | xavier | kaiming | orthogonal
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/9451e70673400885567d08a9e97ade2524c700d0/models/networks.py#L39
'''
30------> def _init_func(m):
classname = m.class.name
if classname.find('InstanceNorm2d') != -1:

The editor reports a lot of errors. Please tell me the correct way to run your code, Thank you.

@uof1745-cmd
Copy link
Owner

Hi, it is common to define weight assignment function in initialization function. I guess the problem lies in the indentation of each line. Different editors modify the indent. Please try to open the file with notepad++and check the indentation at the beginning of each line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants