Git Product home page Git Product logo

Comments (12)

GengCauWong avatar GengCauWong commented on August 15, 2024 1

the pretrained models in dir /result/..

when I run Test_model.py to test the pretrained model,it occur errors.

File "E:/test/ext_portrait_segmentation-master/Test_model.py", line 158, in
lossVal, ElossVal, mIOU_val = val_edge(num_gpu, valLoader, model, criteria, Lovasz)
File "E:\test\ext_portrait_segmentation-master\etc\help_function.py", line 48, in val_edge
epoch_loss.append(loss.item())
UnboundLocalError: local variable 'loss' referenced before assignment

Do you know how to solve it?

from ext_portrait_segmentation.

zhangyunming avatar zhangyunming commented on August 15, 2024

the pretrained models in dir /result/..

from ext_portrait_segmentation.

HYOJINPARK avatar HYOJINPARK commented on August 15, 2024

yes, the pre-trained file is in result folder

from ext_portrait_segmentation.

 avatar commented on August 15, 2024

😎 the file was too small, I didnot notice it

from ext_portrait_segmentation.

peace195 avatar peace195 commented on August 15, 2024

Thanks for great work. The pretrained model's results is not good as in the paper. Is it just a sample pretrained model for testing?

Thank you very much.

from ext_portrait_segmentation.

HYOJINPARK avatar HYOJINPARK commented on August 15, 2024

Could you say more detailed information?

from ext_portrait_segmentation.

peace195 avatar peace195 commented on August 15, 2024

@HYOJINPARK I built a test service based on your pretrained model, the results is not good:
image
image

from ext_portrait_segmentation.

peace195 avatar peace195 commented on August 15, 2024

@HYOJINPARK I tested with
image
image

from ext_portrait_segmentation.

HYOJINPARK avatar HYOJINPARK commented on August 15, 2024

Please check this code and result
img1
mask_img1

Test_image.py.zip

from ext_portrait_segmentation.

ucb-pb avatar ucb-pb commented on August 15, 2024

the pretrained models in dir /result/..

when I run Test_model.py to test the pretrained model,it occur errors.

File "E:/test/ext_portrait_segmentation-master/Test_model.py", line 158, in
lossVal, ElossVal, mIOU_val = val_edge(num_gpu, valLoader, model, criteria, Lovasz)
File "E:\test\ext_portrait_segmentation-master\etc\help_function.py", line 48, in val_edge
epoch_loss.append(loss.item())
UnboundLocalError: local variable 'loss' referenced before assignment

Do you know how to solve it?

The following block of code in help_function.py was indented incorrectly:

with torch.no_grad():
            input_var, target_var, edge_target_var \
                = torch.autograd.Variable(input), torch.autograd.Variable(target), \
                    torch.autograd.Variable(edge_target)

            # run the mdoel
            output = model(input_var)

            # compute the loss
            loss = criterion(output, target_var)
            lossE = 0.5*criterion(output, edge_target_var)

It should be at the same level as

if num_gpu > 0:
            input = input.cuda()
            target = target.cuda()
            edge_target = edge_target.cuda()

Not inside that if statement.

from ext_portrait_segmentation.

ucb-pb avatar ucb-pb commented on August 15, 2024

Please check this code and result
img1
mask_img1

Test_image.py.zip

Thanks for this code

from ext_portrait_segmentation.

shoutOutYangJie avatar shoutOutYangJie commented on August 15, 2024

Great. Too Small .pth.

from ext_portrait_segmentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.