Giter Club home page Giter Club logo

Comments (6)

keyu-tian avatar keyu-tian commented on May 18, 2024

Hi @buxuewushu1314 I just tested the viz code, but did not encounter this problem. Could you double-check whether you download the cnxL384_withdecoder_1kpretrained_spark_style.pth file from https://drive.google.com/file/d/1ZI9Jgtb3fKWE_vDFEly29w-1FWZSNwa0/view?usp=share_link ? I think checking the file will solve the issue.

from spark.

syjabc avatar syjabc commented on May 18, 2024

When I load xxx__1kpretrained.pth or xxxx_still_pretraining.pth and want to have a look at the performance of my pretrained model, I encounter this problem too. How can I get my xxxx_withdecoder_1kpretrained_spark_style.pth when i pretraining ?

from spark.

syjabc avatar syjabc commented on May 18, 2024

I modified the function:build_spark like below
def build_spark(pretraining_pth,spark_model):
pretrained_state = torch.load(pretraining_pth, map_location='cpu')
spark_model.eval(), [p.requires_grad_(False) for p in spark_model.parameters()]
# load the checkpoint
missing, unexpected = spark_model.load_state_dict(pretrained_state['module'], strict=False)
assert len(missing) == 0, f'load_state_dict missing keys: {missing}'
assert len(unexpected) == 0, f'load_state_dict unexpected keys: {unexpected}'
del pretrained_state
return spark

And then it works using xxxx_still_pretraining.pth
ckpt_file = 'your xxxx_still_pretraining.pth path'
spark = 'your spark_model'
spark = build_spark(ckpt_file,spark)

What's more, you may need to modify the function denorm_for_vis in spark.py : 191 if you use your own dataset

from spark.

keyu-tian avatar keyu-tian commented on May 18, 2024

@syjabc have you solved the issue through your code? I think the new build_spark is doing the right thing, using torch.load('xxxx_still_pretraining', 'cpu')['module'] as torch.load('xxxx_withdecoder_1kpretrained_spark_style', 'cpu').

from spark.

syjabc avatar syjabc commented on May 18, 2024

I think it has been solved. Learned so much from your code, thanks for your excellent work.

from spark.

keyu-tian avatar keyu-tian commented on May 18, 2024

Also thank you for helping me to refine this visualisation. In the latest commit 1468df8 i modify the notebook for visualizing your own model.

from spark.

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.