Comments (4)
@thangld201
I am not sure but here are some possible causes:
- BLEU calculation may be slow.
- A classifier is used to determine the style.
To eliminate these effects, can you measure the time between this lines?
NAST/styletransformer/seq2seq.py
Lines 313 to 324 in ef765d4
from nast.
@hzhwcmhf , I found that Line 334: predict_res.append(self.param.volatile.cls.predict_str(sents))
was the cause (took up 99% of the time). I will dive a bit more....not sure why this is slow...
from nast.
@hzhwcmhf , I found that Line 334:
predict_res.append(self.param.volatile.cls.predict_str(sents))
was the cause (took up 99% of the time). I will dive a bit more....not sure why this is slow...
It runs a classifier. Maybe check whether this classifier is on gpu?
from nast.
It runs a classifier. Maybe check whether this classifier is on gpu?
Yeah, you are right, self.param.volatile.cls.net
was on cpu.
In NAST/styletransformer/run_cls.py
, Line 47-69:
L47: parser.add_argument('--cuda', action="store_true", help='Use cuda (gpu).')
...
L69: args.cuda = "cuda" if cargs.cuda else "cpu"
since cargs
was parsed from Line 64 in NAST/styletransformer/main.py
i.e.
cls_param.args = run_cls.run("--dryrun", "--restore", args.clsrestore) # <----- do not have cuda flags
so I changed Line 64 to
cls_param.args = run_cls.run("--cuda", "--dryrun", "--restore", args.clsrestore)
And it worked! Validation now takes less than half a minute (Yelp)!
Thank you!
from nast.
Related Issues (7)
- Code Release ETA HOT 1
- How to generate data? HOT 1
- Running with Custom Dataset HOT 4
- a problem when running run.py HOT 1
- TypeError HOT 3
- The settings for Hyper-Parameters HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nast.