Skip to content

Commit

Permalink
v1.0.6-post1 - Auto detect old/new(current) architecture for the load…
Browse files Browse the repository at this point in the history
…ed model (whoopsie)
  • Loading branch information
rlaphoenix committed Oct 22, 2019
1 parent 67916fd commit a339d98
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/VSGAN.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/dictionaries/pragma.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="vsgan",
version="1.0.6",
version="1.0.6-post1",
author="PRAGMA",
author_email="[email protected]",
description="VapourSynth GAN Implementation using RRDBNet, based on ESRGAN's implementation",
Expand Down
5 changes: 3 additions & 2 deletions vsgan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ def __init__(self, device="cuda"):
def load_model(self, model, scale):
self.model_file = model
self.model_scale = scale
# attempt to use Old Arch, and if that fails, attempt to use Current Arch
# attempt to use New Arch, and if that fails, attempt to use Old Arch
# if both fail to be loaded, it will raise it's original exception
for arch in range(1):
for arch in range(2):
self.rrdb_net_model = self.get_rrdb_net_arch(arch)
try:
self.rrdb_net_model.load_state_dict(torch.load(self.model_file), strict=True)
break
except RuntimeError:
if arch == 1:
raise
Expand Down

0 comments on commit a339d98

Please sign in to comment.