Giter Club home page Giter Club logo

Comments (4)

xiangzhluo avatar xiangzhluo commented on June 4, 2024 1

Did you use ptflops.get_model_complexity_info to calculate the Flops? I saw even the oldest version, the requirements of it is Pytorch 0.4.1 or 1.0, torchvision 0.2.1 but the official PC-DARTS was implemented on pytorch(0.3)...

Is that a problem?

As I know, the official PC-DARTS will be OOM in the newer PyTorch version in here. Maybe
that's the same reason. The operators are not equal mechanism in different versions.

Thanks for your suggestion.

I just checked that it is not caused by the PyTorch version. For the OOM, it is mainly because the newer PyTorch deprecated the volatile and volatile=True does not work anymore. So once you want to assign a parameter without gradient you can use with torch.no_grad() instead. At the very beginning, I have corrected it.

After I get the searched genotype, I want to stack some cells or layers to make a new model (like residual block and resnet50). Usually, in neural architecture search, our aim is to get a simple and small model while maintaining the same level of accuracy, which is suitable for deployment. But the latency (10 times as resnet50) and model complexity (12000M FLOPs) seems a little strange under the ImageNet setting (8 cells). Since the reported FLOPs under ImageNet setting is about 597M FLOPs.

As you can see in the following test codes, I set the output classes = 1000, init_channels=36, cells=14 with the searched genotype, which is the same as the original paper.

from model import NetworkCIFAR as Network
import genotypes

genotype = genotype = eval("genotypes.%s" % "PCDARTS")

with torch.cuda.device(0):
    model = Network(36, 1000, 14, True, genotype)
    model.drop_path_prob = 0.3
    model.eval()
    flops, params =  get_model_complexity_info(model, (3, 224, 224), as_strings=True, print_per_layer_stat=True)
    print("{:<30}  {:<8}".format("Computational complexity: ", flops))
    print("{:<30}  {:<8}".format("Number of parameters: ", params))

I will continue to figure it out.

from pcdarts-tf2.

peteryuX avatar peteryuX commented on June 4, 2024 1
from model import NetworkImageNet as Network

Is the model imported from different way?
You can check it from here.
The feature maps resolution in layers are totally different in each model. HAHAHA...

from pcdarts-tf2.

xiangzhluo avatar xiangzhluo commented on June 4, 2024 1

Yes, you are right! I got it!!!

Thanks for your gentle help. Have a nice day. Hahahaha

from pcdarts-tf2.

peteryuX avatar peteryuX commented on June 4, 2024

Did you use ptflops.get_model_complexity_info to calculate the Flops? I saw even the oldest version, the requirements of it is Pytorch 0.4.1 or 1.0, torchvision 0.2.1 but the official PC-DARTS was implemented on pytorch(0.3)...

Is that a problem?

As I know, the official PC-DARTS will be OOM in the newer PyTorch version in here. Maybe
that's the same reason. The operators are not equal mechanism in different versions.

from pcdarts-tf2.

Related Issues (2)

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.